mirror of
https://github.com/rocky-linux/infrastructure
synced 2024-10-31 20:21:23 +00:00
fcdf86b31c
This commit appends the README.md to state that yaml files should start with `---` and end with `...`. This also addresses some linting warnings that were not appearing during pre-commit on local system.
58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
---
|
|
|
|
- hosts: localhost
|
|
connection: local
|
|
vars:
|
|
force_purge: true
|
|
roles_installation_dir: roles/public
|
|
collection_installation_dir: collections
|
|
installation_prefix: ../
|
|
pre_tasks:
|
|
# example prepare ansible box for execution
|
|
# - name: install required pip modules on the host running ansible
|
|
# pip:
|
|
# name:
|
|
# - jmespath
|
|
# - netaddr
|
|
# - python-consul
|
|
# - pyvmomi
|
|
# - python-ldap
|
|
# - twine
|
|
|
|
- name: Remove existing public roles
|
|
file:
|
|
path: "{{ installation_prefix }}{{ roles_installation_dir }}"
|
|
state: absent
|
|
when: force_purge | bool
|
|
|
|
- name: Install all public roles
|
|
command: >
|
|
ansible-galaxy role install
|
|
{{ ( force_purge | bool ) | ternary('--force','') }}
|
|
--role-file {{ installation_prefix }}roles/requirements.yml
|
|
--roles-path {{ installation_prefix }}{{ roles_installation_dir }}
|
|
register: galaxy_install_role
|
|
changed_when: '"Installing " in galaxy_install_role.stdout'
|
|
|
|
- name: Install needed collections
|
|
command: >
|
|
ansible-galaxy collection install
|
|
{{ ( force_purge | bool ) | ternary('--force-with-deps','') }}
|
|
-r {{ installation_prefix }}roles/requirements.yml
|
|
-p {{ installation_prefix }}{{ collection_installation_dir }}
|
|
register: galaxy_install_collection
|
|
changed_when: '"Installing " in galaxy_install_collection.stdout'
|
|
|
|
- name: cleanup old ssh known_hosts - remove
|
|
file:
|
|
path: "../tmp/known_hosts"
|
|
state: absent
|
|
mode: "0644"
|
|
|
|
- name: cleanup old ssh known_hosts - blank
|
|
file:
|
|
path: "../tmp/known_hosts"
|
|
state: touch
|
|
mode: "0644"
|
|
...
|