You've already forked role_ansible
Compare commits
3 Commits
4c9b9c2054
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7240552dfc | |||
| 7c5742451b | |||
| 1cca41ec27 |
@@ -1,12 +1,9 @@
|
|||||||
---
|
---
|
||||||
# defaults file for ansible
|
# defaults file for ansible
|
||||||
|
|
||||||
elbisna_prerequisites:
|
elbisna_inject_packages:
|
||||||
- pipx
|
|
||||||
|
|
||||||
elbisna_pip_packages:
|
|
||||||
- ansible
|
|
||||||
- netaddr
|
- netaddr
|
||||||
|
- dnspython
|
||||||
|
|
||||||
elbisna_vault_passwd: ""
|
elbisna_vault_passwd: ""
|
||||||
|
|
||||||
|
|||||||
9
handlers/main.yml
Normal file
9
handlers/main.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
# handlers file for ansible
|
||||||
|
|
||||||
|
- name: Apply installation
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- /usr/bin/rpm-ostree
|
||||||
|
- apply-live
|
||||||
|
become: true
|
||||||
@@ -11,5 +11,8 @@ galaxy_info:
|
|||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- all
|
- all
|
||||||
|
- name: CoreOS
|
||||||
|
versions:
|
||||||
|
- 41
|
||||||
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# tasks file for ansible
|
# tasks file for ansible
|
||||||
|
|
||||||
- name: Déployer le mot de passe vault
|
- name: Deploy vault password
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: "~{{ elbisna_user }}/.ansible_vault_passwd"
|
dest: "~{{ elbisna_user }}/.ansible_vault_passwd"
|
||||||
content: "{{ elbisna_vault_passwd }}"
|
content: "{{ elbisna_vault_passwd }}"
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
become: true
|
become: true
|
||||||
diff: false
|
diff: false
|
||||||
|
|
||||||
- name: Déployer la configuration
|
- name: Deploy ansible.cfg
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: ansible.cfg.j2
|
src: ansible.cfg.j2
|
||||||
dest: "~{{ elbisna_user }}/.ansible.cfg"
|
dest: "~{{ elbisna_user }}/.ansible.cfg"
|
||||||
|
|||||||
8
tasks/installation-apt.yml
Normal file
8
tasks/installation-apt.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
# tasks file for ansible
|
||||||
|
|
||||||
|
- name: Install prerequisites package
|
||||||
|
ansible.builtin.apt:
|
||||||
|
install_recommends: false
|
||||||
|
name: pipx
|
||||||
|
become: true
|
||||||
18
tasks/installation-atomic_container.yml
Normal file
18
tasks/installation-atomic_container.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
# tasks file for borgmatic
|
||||||
|
|
||||||
|
- name: Install prerequisites package
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- /usr/bin/rpm-ostree
|
||||||
|
- install
|
||||||
|
- --allow-inactive
|
||||||
|
- --assumeyes
|
||||||
|
- --idempotent
|
||||||
|
- pipx
|
||||||
|
creates: /sysroot/ostree/repo/refs/heads/rpmostree/pkg/borgmatic
|
||||||
|
become: true
|
||||||
|
notify: Apply installation
|
||||||
|
|
||||||
|
- name: Flush handlers
|
||||||
|
meta: flush_handlers
|
||||||
31
tasks/installation-service.yml
Normal file
31
tasks/installation-service.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
# tasks file for ansible
|
||||||
|
|
||||||
|
- name: Install ansible
|
||||||
|
community.general.pipx:
|
||||||
|
name: ansible
|
||||||
|
state: latest
|
||||||
|
install_deps: true
|
||||||
|
become: true
|
||||||
|
environment:
|
||||||
|
PIPX_HOME: /opt/pipx
|
||||||
|
PIPX_BIN_DIR: /usr/local/bin
|
||||||
|
|
||||||
|
- name: Inject packages
|
||||||
|
community.general.pipx:
|
||||||
|
name: ansible
|
||||||
|
inject_packages: "{{ elbisna_inject_packages }}"
|
||||||
|
state: inject
|
||||||
|
become: true
|
||||||
|
environment:
|
||||||
|
PIPX_HOME: /opt/pipx
|
||||||
|
PIPX_BIN_DIR: /usr/local/bin
|
||||||
|
|
||||||
|
- name: Upgrade ansible
|
||||||
|
community.general.pipx:
|
||||||
|
name: ansible
|
||||||
|
state: upgrade_all
|
||||||
|
become: true
|
||||||
|
environment:
|
||||||
|
PIPX_HOME: /opt/pipx
|
||||||
|
PIPX_BIN_DIR: /usr/local/bin
|
||||||
@@ -9,9 +9,29 @@
|
|||||||
|
|
||||||
- name: Installer ansible
|
- name: Installer ansible
|
||||||
community.general.pipx:
|
community.general.pipx:
|
||||||
name: "{{ item }}"
|
name: ansible
|
||||||
state: latest
|
state: latest
|
||||||
install_deps: true
|
install_deps: true
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ elbisna_user }}"
|
environment:
|
||||||
loop: "{{ elbisna_pip_packages }}"
|
PIPX_HOME: /opt/pipx
|
||||||
|
PIPX_BIN_DIR: /usr/local/bin
|
||||||
|
|
||||||
|
- name: Injecter des paquets
|
||||||
|
community.general.pipx:
|
||||||
|
name: ansible
|
||||||
|
inject_packages: "{{ elbisna_inject_packages }}"
|
||||||
|
state: inject
|
||||||
|
become: true
|
||||||
|
environment:
|
||||||
|
PIPX_HOME: /opt/pipx
|
||||||
|
PIPX_BIN_DIR: /usr/local/bin
|
||||||
|
|
||||||
|
- name: Mettre à jour l'environnement
|
||||||
|
community.general.pipx:
|
||||||
|
name: ansible
|
||||||
|
state: upgrade_all
|
||||||
|
become: true
|
||||||
|
environment:
|
||||||
|
PIPX_HOME: /opt/pipx
|
||||||
|
PIPX_BIN_DIR: /usr/local/bin
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
---
|
---
|
||||||
# tasks file for ansible
|
# tasks file for ansible
|
||||||
|
|
||||||
- name: Importer les tâches d'installation
|
- name: Include installation tasks
|
||||||
tags: installation
|
ansible.builtin.include_tasks:
|
||||||
ansible.builtin.import_tasks: installation.yml
|
file: installation-{{ ansible_facts['pkg_mgr'] }}.yml
|
||||||
|
|
||||||
- name: Importer les tâches de configuration
|
- name: Import pipx installation tasks
|
||||||
tags: configuration
|
ansible.builtin.import_tasks:
|
||||||
ansible.builtin.import_tasks: configuration.yml
|
file: installation-service.yml
|
||||||
|
|
||||||
|
- name: Import configuration tasks
|
||||||
|
ansible.builtin.import_tasks:
|
||||||
|
file: configuration.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user