89 lines
2.4 KiB
YAML
89 lines
2.4 KiB
YAML
- name: Paquets prérequis
|
|
ansible.builtin.package:
|
|
name:
|
|
- build-essential
|
|
- apparmor
|
|
- apparmor-utils
|
|
- curl
|
|
- jq
|
|
- git
|
|
|
|
- name: Configure bash completion pour kubectl
|
|
ansible.builtin.shell: |
|
|
kubectl completion bash > /etc/bash_completion.d/kubectl
|
|
args:
|
|
creates: /etc/bash_completion.d/kubectl
|
|
|
|
- name: Répertoire awx
|
|
ansible.builtin.file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
mode: "{{ item.mode }}"
|
|
with_items:
|
|
- path: /opt/awx
|
|
mode: u=rwx,g=rwx,o=
|
|
- path: /opt/awx/operator
|
|
mode: u=rwx,g=rwx,o=
|
|
- path: /opt/awx/base
|
|
mode: u=rwx,g=rwx,o=
|
|
- path: /data1/awx
|
|
mode: u=rwx,g=rwx,o=rx
|
|
- path: /data1/awx/postgres-15
|
|
mode: u=rwx,g=rwx,o=rx
|
|
- path: /data1/awx/projects
|
|
mode: u=rwx,g=rwx,o=rx
|
|
|
|
- name: Kustomization operator
|
|
ansible.builtin.template:
|
|
src: operator/kustomization.yaml
|
|
dest: "/opt/awx/operator/"
|
|
mode: u=rwx,g=rwx,o=
|
|
notify:
|
|
- update-kustomization-operator
|
|
- pause2
|
|
|
|
- name: Force exécution des handlers maintenant
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: Kustomization base
|
|
ansible.builtin.template:
|
|
src: base/{{ item }}
|
|
dest: "/opt/awx/base/"
|
|
mode: u=rwx,g=rwx,o=
|
|
with_items:
|
|
- kustomization.yaml
|
|
- pv.yaml
|
|
- pvc.yaml
|
|
- awx.yaml
|
|
notify:
|
|
- update-kustomization-base
|
|
|
|
- name: Copie le certificat
|
|
ansible.builtin.get_url:
|
|
url: "{{ lookup('env', 'AAP_RESSOURCES_URL') }}/libretic/cert/libretic.fr/{{ item.src }}"
|
|
dest: "/opt/awx/base/{{ item.dest }}"
|
|
username: "{{ lookup('env', 'AAP_RESSOURCES_USER') }}"
|
|
password: "{{ lookup('env', 'AAP_RESSOURCES_PASSWORD') }}"
|
|
mode: u=rw,g=r,o=
|
|
owner: root
|
|
group: root
|
|
with_items:
|
|
- src: fullchain1.pem
|
|
dest: tls.crt
|
|
- src: privkey1.pem
|
|
dest: tls.key
|
|
notify:
|
|
- update-kustomization-base
|
|
|
|
- name: Force exécution des handlers maintenant
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: Affiche message deploiement
|
|
ansible.builtin.debug:
|
|
msg: |
|
|
Le deploiement des pods kubernetes est en cours et peut prendre jusqu'à 15 minutes suivant l'environnement déployé.
|
|
Pour voir l'état des pods, exécuter :
|
|
kubectl -n awx get pods
|
|
|
|
Pour consulter les logs des tâches de déploiement, exécuter :
|
|
kubectl -n awx logs -f deployments/awx-operator-controller-manager
|