voxpupuli / puppet_metadata

The gem intends to provide an abstraction over Puppet's metadata.json file. Its API allow easy iteration over its illogical data structures.
Apache License 2.0
3 stars 13 forks source link

beaker: append puppet version to hostname #65

Closed bastelfreak closed 1 year ago

bastelfreak commented 1 year ago

This will ensure that a single CI run creates unique hostnames. Before:

$ bundle exec metadata2gha --domain foo.example.com --pidfile-workaround true metadata.json
beaker_setfiles=[{"name":"CentOS 7","value":"centos7-64{hostname=centos7-64.foo.example.com,image=centos:7.6.1810}"},{"name":"Debian 10","value":"debian10-64{hostname=debian10-64.foo.example.com}"},{"name":"Debian 11","value":"debian11-64{hostname=debian11-64.foo.example.com}"},{"name":"Ubuntu 18.04","value":"ubuntu1804-64{hostname=ubuntu1804-64.foo.example.com}"},{"name":"Ubuntu 20.04","value":"ubuntu2004-64{hostname=ubuntu2004-64.foo.example.com}"}]
puppet_major_versions=[{"name":"Puppet 7","value":7,"collection":"puppet7"},{"name":"Puppet 6","value":6,"collection":"puppet6"}]
puppet_unit_test_matrix=[{"puppet":7,"ruby":"2.7"},{"puppet":6,"ruby":"2.5"}]
github_action_test_matrix=[{"setfile":{"name":"CentOS 7","value":"centos7-64{hostname=centos7-64.foo.example.com,image=centos:7.6.1810}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"CentOS 7","value":"centos7-64{hostname=centos7-64.foo.example.com,image=centos:7.6.1810}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Debian 10","value":"debian10-64{hostname=debian10-64.foo.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Debian 10","value":"debian10-64{hostname=debian10-64.foo.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Debian 11","value":"debian11-64{hostname=debian11-64.foo.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Debian 11","value":"debian11-64{hostname=debian11-64.foo.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Ubuntu 18.04","value":"ubuntu1804-64{hostname=ubuntu1804-64.foo.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Ubuntu 18.04","value":"ubuntu1804-64{hostname=ubuntu1804-64.foo.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Ubuntu 20.04","value":"ubuntu2004-64{hostname=ubuntu2004-64.foo.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Ubuntu 20.04","value":"ubuntu2004-64{hostname=ubuntu2004-64.foo.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}}]

And with this change:

$ bundle exec metadata2gha metadata.json --domain example.com

beaker_setfiles=[{"name":"CentOS 7","value":"centos7-64{hostname=centos7-64.example.com}"},{"name":"CentOS 8","value":"centos8-64{hostname=centos8-64.example.com}"},{"name":"Debian 10","value":"debian10-64{hostname=debian10-64.example.com}"},{"name":"Debian 11","value":"debian11-64{hostname=debian11-64.example.com}"},{"name":"Ubuntu 18.04","value":"ubuntu1804-64{hostname=ubuntu1804-64.example.com}"},{"name":"Ubuntu 20.04","value":"ubuntu2004-64{hostname=ubuntu2004-64.example.com}"}]
puppet_major_versions=[{"name":"Puppet 7","value":7,"collection":"puppet7"},{"name":"Puppet 6","value":6,"collection":"puppet6"}]
puppet_unit_test_matrix=[{"puppet":7,"ruby":"2.7"},{"puppet":6,"ruby":"2.5"}]
github_action_test_matrix=[{"setfile":{"name":"CentOS 7","value":"centos7-64{hostname=centos7-64-puppet7.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"CentOS 7","value":"centos7-64{hostname=centos7-64-puppet6.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"CentOS 8","value":"centos8-64{hostname=centos8-64-puppet7.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"CentOS 8","value":"centos8-64{hostname=centos8-64-puppet6.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Debian 10","value":"debian10-64{hostname=debian10-64-puppet7.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Debian 10","value":"debian10-64{hostname=debian10-64-puppet6.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Debian 11","value":"debian11-64{hostname=debian11-64-puppet7.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Debian 11","value":"debian11-64{hostname=debian11-64-puppet6.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Ubuntu 18.04","value":"ubuntu1804-64{hostname=ubuntu1804-64-puppet7.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Ubuntu 18.04","value":"ubuntu1804-64{hostname=ubuntu1804-64-puppet6.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}},{"setfile":{"name":"Ubuntu 20.04","value":"ubuntu2004-64{hostname=ubuntu2004-64-puppet7.example.com}"},"puppet":{"name":"Puppet 7","value":7,"collection":"puppet7"}},{"setfile":{"name":"Ubuntu 20.04","value":"ubuntu2004-64{hostname=ubuntu2004-64-puppet6.example.com}"},"puppet":{"name":"Puppet 6","value":6,"collection":"puppet6"}}]

On purpose, we only modify github_action_test_matrix, not beaker_setfiles. Because beaker_setfiles is not Puppet Version aware and contains only one Setfile per OS version, not one (per OS)*(per Puppet version)

Contains also https://github.com/voxpupuli/puppet_metadata/pull/64