-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: omit setting group for certificate tests on cockpit 330 and later
cockpit 330 uses DynamicUser instead of the hard coded user/group in the package, so omit setting group, but keep group for other platforms. refactor the certificate test code to DRY it a bit Signed-off-by: Rich Megginson <[email protected]>
- Loading branch information
Showing
6 changed files
with
122 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
# install so that we can get version, and create group on platforms | ||
# where we need the group | ||
- name: Install cockpit | ||
include_role: | ||
name: linux-system-roles.cockpit | ||
public: true | ||
vars: | ||
cockpit_packages: minimal | ||
|
||
- name: Collect installed package versions | ||
package_facts: | ||
|
||
# NOTE: There is no way to set __cockpit_version to be a native int | ||
# without using ANSIBLE_JINJA2_NATIVE | ||
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-jinja2-native | ||
- name: Set cockpit version for tests | ||
set_fact: | ||
__cockpit_version: "{{ ansible_facts.packages['cockpit-ws'][0].version }}" | ||
|
||
# Fixed in cockpit 255 (https://github.com/cockpit-project/cockpit/commit/6ec4881856e) | ||
- name: Allow certmonger to write into Cockpit's certificate directory | ||
when: __cockpit_version | int < 255 | ||
file: | ||
path: /etc/cockpit/ws-certs.d | ||
state: directory | ||
setype: cert_t | ||
mode: "0755" | ||
register: __cockpit_test_cert_dir | ||
|
||
# returns global variable __cockpit_test_group | ||
- name: Get name of cockpit group to use | ||
include_tasks: tasks/get_cockpit_group.yml | ||
when: __cockpit_version | int < 330 | ||
|
||
- name: Set name of cockpit group to use to None | ||
set_fact: | ||
__cockpit_test_group: null | ||
when: __cockpit_version | int >= 330 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.