From c8f2469b67eefa5f302c96b7ab88f36cc1136972 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Fri, 1 Mar 2024 14:04:03 +0100 Subject: [PATCH 1/3] Add group_roles role --- group_vars/all/ah_group_roles.yml | 14 ++++++++++++++ playbooks/hub_config.yml | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 group_vars/all/ah_group_roles.yml diff --git a/group_vars/all/ah_group_roles.yml b/group_vars/all/ah_group_roles.yml new file mode 100644 index 0000000..cd5475b --- /dev/null +++ b/group_vars/all/ah_group_roles.yml @@ -0,0 +1,14 @@ +--- +# Documentation: https://github.com/ansible/galaxy_collection/blob/devel/roles/group_roles/README.md +ah_group_roles: + + # - state: present + # groups: + # - foo + # role_list: + # - roles: + # - galaxy.execution_environment_namespace_owner + # targets: + # execution_environments: + # - bar +... diff --git a/playbooks/hub_config.yml b/playbooks/hub_config.yml index 663d4be..6c2de60 100644 --- a/playbooks/hub_config.yml +++ b/playbooks/hub_config.yml @@ -34,6 +34,11 @@ name: infra.ah_configuration.group when: ah_groups | length is not match('0') + - name: Include group_roles role + ansible.builtin.include_role: + name: infra.ah_configuration.group_roles + when: ah_group_roles | length is not match('0') + - name: Include user role ansible.builtin.include_role: name: infra.ah_configuration.user From 5edd803c40c5617b3e31b8d8029586b7714608ea Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Fri, 1 Mar 2024 14:04:45 +0100 Subject: [PATCH 2/3] Fix ah_groups failing to create the admin group --- group_vars/all/ah_groups.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/group_vars/all/ah_groups.yml b/group_vars/all/ah_groups.yml index eb81f18..7f6d33f 100644 --- a/group_vars/all/ah_groups.yml +++ b/group_vars/all/ah_groups.yml @@ -1,7 +1,8 @@ --- -ah_groups: [] - # Currently not working - # - name: admin - # perms: all - # state: present +# Role permissions using the 'perms' option is deprecated and will be removed +# in galaxy_collection 3.0.0.Instead, set the group's roles in +# groups_vars/all/ah_group_roles.yml +ah_groups: + - name: admin + state: present ... From 9bd3cf36180e10e586e668e19b214a16d08690ac Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Sat, 2 Mar 2024 17:00:31 +0100 Subject: [PATCH 3/3] fix empty var --- group_vars/all/ah_group_roles.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/group_vars/all/ah_group_roles.yml b/group_vars/all/ah_group_roles.yml index cd5475b..da9d9ca 100644 --- a/group_vars/all/ah_group_roles.yml +++ b/group_vars/all/ah_group_roles.yml @@ -1,7 +1,6 @@ --- # Documentation: https://github.com/ansible/galaxy_collection/blob/devel/roles/group_roles/README.md -ah_group_roles: - +ah_group_roles: [] # - state: present # groups: # - foo