Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 8a589333 authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT Committed by Thomas MICHEL
Browse files

feat: enable fact gathering in multiple playbooks and add pre-tasks for consistent setup

parent f118354e
No related branches found
No related tags found
No related merge requests found
--- ---
- name: Bootstrap a new server - name: Bootstrap a new server
hosts: all hosts: all
gather_facts: true
become: true become: true
tags: tags:
- bootstrap - bootstrap
- ssh - ssh
gather_facts: false
pre_tasks:
- name: Gather facts
ansible.builtin.setup:
tags: always
tasks: tasks:
- name: Set configured port fact - name: Set configured port fact
......
--- ---
- name: Create users (including deploy user) - name: Create users (including deploy user)
hosts: all hosts: all
gather_facts: false gather_facts: true
become: true become: true
tags: tags:
- bootstrap - bootstrap
vars: vars:
ansible_ssh_user: "{{ distrib_user }}" ansible_ssh_user: "{{ distrib_user }}"
pre_tasks:
- name: Gather facts
ansible.builtin.setup:
tags: always
roles: roles:
- singleplatform-eng.users - singleplatform-eng.users
......
--- ---
- name: Common configuration - name: Common configuration
hosts: all hosts: all
gather_facts: true
become: true become: true
tags: tags:
- common - common
pre_tasks: pre_tasks:
- name: Gather facts
ansible.builtin.setup:
tags: always
- name: Get active network interface name - name: Get active network interface name
ansible.builtin.include_tasks: tasks/netplan.yml ansible.builtin.include_tasks: tasks/netplan.yml
......
--- ---
- name: Display information about target hosts+ on provision - name: Display information about target hosts+ on provision
hosts: all hosts: all
gather_facts: true
tags: tags:
- info - info
pre_tasks:
- name: Gather facts
ansible.builtin.setup:
tags: always
tasks: tasks:
- name: Print information message - name: Print information message
ansible.builtin.debug: ansible.builtin.debug:
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- name: Playbook for local backup tasks - name: Playbook for local backup tasks
hosts: local_backup hosts: local_backup
vars_files: group_vars/local_backup/borg.yml vars_files: group_vars/local_backup/borg.yml
gather_facts: true
become: true become: true
tags: tags:
- backup - backup
...@@ -9,6 +10,10 @@ ...@@ -9,6 +10,10 @@
- borg - borg
pre_tasks: pre_tasks:
- name: Gather facts
ansible.builtin.setup:
tags: always
- name: Create backup folder for BorgBackup repository - name: Create backup folder for BorgBackup repository
ansible.builtin.file: ansible.builtin.file:
path: "{{ borg_repository }}" path: "{{ borg_repository }}"
......
...@@ -2,12 +2,17 @@ ...@@ -2,12 +2,17 @@
- name: Playbook for remote backup tasks - name: Playbook for remote backup tasks
hosts: remote_backup hosts: remote_backup
vars_files: group_vars/remote_backup/borg.yml vars_files: group_vars/remote_backup/borg.yml
gather_facts: true
become: true become: true
tags: tags:
- backup - backup
- remote_backup - remote_backup
pre_tasks: pre_tasks:
- name: Gather facts
ansible.builtin.setup:
tags: always
- name: Deploy SSH keys for BorgBackup - name: Deploy SSH keys for BorgBackup
when: backup_enabled | default(true) | bool when: backup_enabled | default(true) | bool
block: block:
......
--- ---
- name: Security playbook - name: Security playbook
hosts: all hosts: all
gather_facts: true
become: true become: true
tags: tags:
- security - security
tasks: tasks:
- name: Gather facts
ansible.builtin.setup:
tags: always
- name: Install and setup Crowdsec - name: Install and setup Crowdsec
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: tasks/crowdsec.yml file: tasks/crowdsec.yml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment