ComputeCanada / magic_castle

Terraform modules to replicate the HPC user experience in the cloud
MIT License
124 stars 36 forks source link

Allow Puppetfile to be refreshed #304

Closed cmd-ntrf closed 4 months ago

cmd-ntrf commented 5 months ago

In puppet.yaml, we currently have this:

%{ if puppetfile != "" ~}
%{ if strcontains(puppetfile, "forge") ~}
  - cat /etc/puppetlabs/Puppetfile  > /etc/puppetlabs/code/environments/production/Puppetfile
%{ else }
  - cat /etc/puppetlabs/Puppetfile >> /etc/puppetlabs/code/environments/production/Puppetfile
%{ endif ~}
  - rm /etc/puppetlabs/Puppetfile
%{ endif ~}

We could instead, keep the Puppetfile, and make a second call to r10k by specifying the Puppetfile path and the moduledir path.

USAGE
    r10k puppetfile install

OPTIONS
       --force                             Force locally changed files to be
                                           overwritten
       --module-exclude-regex=<value>      A regex to exclude modules from
                                           installation. Helpful in CI
                                           environments.
       --moduledir=<value>                 Path to install modules to
       --puppetfile=<value>                Path to puppetfile

Puppetfile could be included in the puppetserver_etc zip file and the r10k command could be called by the provision module.