-
Notifications
You must be signed in to change notification settings - Fork 21
tests: install a different package on CentOS #261
tests: install a different package on CentOS #261
Conversation
tests/improved-sanity-test/main.yml
Outdated
- role: rpm_ostree_install | ||
packages: ntp | ||
reboot: false | ||
when: ansible_distribution == 'CentOS' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems OK, but isn't it more usual Ansible style to derive variables in vars.yml
and then reference those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that sounds right. I'll fix that.
I found an issue when running the |
The |
I think what is happening on My opinion is that this particular part of the |
I agree since its a valid failure on the test. The error in the log throws you off but that's the nature of commands that automatically initiate reboots using Ansible. Overall this LGTM. Great work on cleaning it up and adding in additional functionality. |
The `rpm_ostree_install*` and `rpm_ostree_uninstall*` roles had some limitations when first created. Namely, only being able to be used once per playbook and being unable to check for a binary that did not match the package name. This changes the roles to use the `allow_duplicates` boolean, so that they may be used multiple times in the same playbook. The `*verify` roles have also been changed to allow for checking for a different binary name than what is used by the package. For example, the `ntp` package installs an `ntpd` binary, whereas the `httpd` package installs an `httpd` binary.
In projectatomic#254, it is noted that the package layering of `httpd` isn't working on CentOS because the `centos-logos` dependency is trying to layer files on `/boot`. Until CentOS gets a version of `rpm-ostree` that supports layering on `/boot` (see coreos/rpm-ostree#969), we need to use a different package to test package layering in CentOS. This change brings in a conditional installation of `ntp` in the CentOS case, until we have a newer version of `rpm-ostree` to use.
This changes how the variables used by the `improved-sanity-test` are loaded in each playbook section. Commonly used variables are now found in `vars/common.yml` and are loaded for each playbook section. Additional variables that may change per OS platform, are broken out into separate files. By supplying a list of files to the `vars_files:` statement, Ansible will try to import each file in the list and stopping when a file is found.[0] This allows us to override any variables per OS while maintaing sensible defaults. [0] http://docs.ansible.com/ansible/latest/playbooks_conditionals.html#conditional-imports
When running a role multiple times in a playbook, we can run into problems with variables since they all live in the same namespace. Notably, when you run a role multiple times, variables that are optional but have been defined, will carry over to the next execution of the role. Or if two roles have the same variable name, you can get values stomping on each other. This commit tries to alleviate some of these problems by updating the variable names in the roles to be unique to the role. Additionally, when using roles multiple times in playbooks, both required and optional variables are explicitly defined to avoid any overwriting.
8dc6f6c
to
329f778
Compare
Rebased on master and squashed a fixup in the process ⬆️ |
bot, retest this please |
This PR includes two changes:
The
rpm_ostree_install*
andrpm_ostree_uninstall*
roles have been enhanced so that they can be run multiple times in the same playbook. Additionally, the*verify
roles can now check for a binary that does not match the package name. For example, check forntpd
whenntp
is installed.ntp
package on CentOSThe version of
rpm-ostree
in CentOS doesn't support layering files on/boot
and this is causing the install ofhttpd
to fail because of thecentos-logos
dependency that gets pulled in. We'll temporarily test package layering using thentp
package on CentOS until CentOS gets a version ofrpm-ostree
that supports sticking files in/boot
.Closes #254