## Update .sync.yml
Add the following to your .sync.yml.
```
".gitlab-ci.yml":
delete: true
appveyor.yml:
delete: true
.github/workflows/auto_release.yml:
unmanaged: false
.github/workflows/ci.yml:
unmanaged: false # may need set to true if you do not use the `litmus:acceptance:parallel` rake task
.github/workflows/nightly.yml:
unmanaged: false # may need set to true if you do not use the `litmus:acceptance:parallel` rake task
.github/workflows/release.yml:
unmanaged: false
```
## PDK
Run `pdk update` to update the module using the latest template.
## Workflows
Running PDK Update should do this for you (*with the exception of `mend.yml`*), but just for context:
Make use of reusable templates found [here](https://github.com/puppetlabs/cat-github-actions/tree/main/.github/workflows).
`auto_release.yml` -> `module_release_prep.yml` -> this uses the new changelog generator that does not support HISTORY.md, so all PRs will need labelled)
`release.yml` -> `module_release.yml`
`spec.yml` -> `module_ci.yml`
Noticed the module has acceptance tests, unsure of the format but you may be able to use `module_acceptance.yml` if they use the`litmus:acceptance:parallel` rake task.
Take a look at [puppetlabs-motd](https://github.com/puppetlabs/puppetlabs-motd/tree/main/.github/workflows) module and see how the reusable templates are implemented.
Remove traces of honeycomb in workflows if not required. Found an example of its removal [here](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/622/commits/0a8ecc6db1a707d2ee8b01b1b97facd79b232e74).
**Add the mend scanning reusable workflow, PDK Update will not do this for you**
## Add Pull request template
Add a template for submitting pull requests, you can just lift the one [here](https://github.com/puppetlabs/puppetlabs-motd/blob/main/.github/pull_request_template.md).
## Rubocop
1. Edit the Gemfile and bump the following gems**
```
rubocop ~> 1.48.1
rubocop-rspec ~> 2.19
rubocop-performance ~> 1.16
```
2. Run bundle install
`bundle install --path .bundle`
3. Configure Rubocop
```
TargetRubyVersion: ‘2.6’ (minimum ruby version used by puppet server)
NewCops: enable
ExtraDetails: true
DisplayStyleGuide: true
```
4. Remove all non configuration options from rubocop.yml, i.e. anything which **does not** have an enforced style or specific exclude:
```
Style/Documentation:
Exclude:
- lib/puppet/parser/functions/**/*
- spec/**/*
Style/WordArray:
EnforcedStyle: brackets
```
5. Generate a .rubocop_todo.yml
`bundle exec rubocop --auto-gen-config`
6. Make sure that .rubocop.yml is inheriting from the new config
`inherit_from: .rubocop_todo.yml`
7. Run rubocop
`bundle exec rubocop`
After running --auto-gen-config, rubocop will report that there are no issues. The most managable way forward is to comment out cops in .rubocop_todo.yml one by one.
```
Comment out cop in .rubocop_todo.yml
Run rubocop
Fix the reported issues (manually, -a or -A depending on situation)
```
Some fixes will break the module, so you can just opt to leave them in the `.rubocop_todo.yml`
## Puppet Lint
Remove the following rules from `.puppet-lint.rc`
```
--no-strict_indent-check
--no-manifest_whitespace_missing_newline_end_of_file-check
```
and fix any issues with linter. If you need to disable these checks, opt to disable inline.
## Audit for legacy facts
Ensure the module is no longer using legacy facts (like below), as these will not work with puppet 8. You can replace these with their supported counterparts.
`$::operatingsystem` -> `$facts['os']['family']`
## Changes to metadata.json
Update the following dependencies to the below:
```
{
"name": "puppetlabs/service",
"version_requirement": ">= 1.3.0 < 4.0.0"
}
```
```
{
"name": "puppetlabs/package",
"version_requirement": ">= 1.3.0 < 4.0.0"
}
```
```
{
"name": "puppetlabs/inifile",
"version_requirement": ">= 1.3.0 < 7.0.0"
}
```
Exclude puppet 6 from the matrix.
```
{
"name": "puppet",
"version_requirement": ">= 7.0.0 < 9.0.0"
}
```
Add support for the following OS (If applicable):
`Ubuntu 22.04`
`SLES 15`
`Redhat 9`