Skip to content

Commit

Permalink
Move ansible.posix and community.general installation to control-node…
Browse files Browse the repository at this point in the history
… main
  • Loading branch information
liquidat committed Jun 22, 2021
1 parent 1fb0e19 commit 74d5adc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
2 changes: 0 additions & 2 deletions roles/control_node/tasks/f5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
register: f5networks
loop:
- f5networks.f5_modules
- community.general
- community.docker
- ansible.posix
until: f5networks is not failed
retries: 5
28 changes: 9 additions & 19 deletions roles/control_node/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,17 @@
group: "{{ username }}"
state: directory

- name: make sure .ansiblt is created
file:
path: "/home/{{username}}/.ansible/"
owner: "{{ username }}"
group: "{{ username }}"
state: directory

# we need a collection to be present on the control node

- name: install community.general collection
command:
cmd: "ansible-galaxy collection install -f -p /home/{{ username }}/.ansible/collections/ community.general"

- name: fix collection ownership permissions
file:
path: "/home/{{ username }}/.ansible/collections"
state: directory
owner: "{{ username }}"
group: "{{ username }}"
mode: 755
recurse: yes
- name: install necessary collections
become_user: "{{ username }}"
shell: "ansible-galaxy collection install {{ item }} --force-with-deps "
register: controlcollections
loop:
- community.general
- ansible.posix
until: controlcollections is not failed
retries: 5

# This may look redundant, but you can't put these in a loop because the
# ansible_user will not be templated the way you expect when running under
Expand Down

0 comments on commit 74d5adc

Please sign in to comment.