MAJ role AWX

This commit is contained in:
root
2024-01-30 11:38:16 +01:00
parent 30c7275ba6
commit 6fbad9d9fa
5 changed files with 34 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
---
- name: Preparation
ansible.builtin.shell: curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.5+k3s1 sh -s - --write-kubeconfig-mode 644 --node-ip "{{ awx_ip }}" --flanel-iface "{{ awx_if }}"
ansible.builtin.shell: curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.5+k3s1 sh -s - --write-kubeconfig-mode 644 --node-ip "{{ awx_ip }}" --flannel-iface "{{ awx_if }}"
- name: clonage du dépot awx-on-k3s
git:
@@ -9,21 +9,34 @@
clone: yes
force: yes
- name: Git checkout
ansible.builtin.shell: "git checkout 2.10.0"
args:
chdir: "{{ awx_dir }}"
- name: Deploiement AWX Operator ...
ansible.builtin.shell: "kubectl apply -k operator"
args:
chdir: "{{ awx_dir }}"
- name: Git checkout
ansible.builtin.git:
repo: 'https://github.com/kurokobo/awx-on-k3s.git'
dest: "{{ awx_dir }}"
version: release-2.10.0
#- name: Git checkout
#ansible.builtin.git:
#repo: 'https://github.com/kurokobo/awx-on-k3s.git'
#dest: "{{ awx_dir }}"
#version: release-2.10.0
- name: Generation de certification auto-signé
ansible.builtin.shell: 'openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -out ./base/tls.crt -keyout ./base/tls.key -subj "/CN={{ awx_host }}/O={{ awx_host }}" -addext "subjectAltName = DNS:{{ awx_host }}"'
args:
chdir: "{{ awx_dir }}"
chdir: "{{ awx_dir }}"
- name: Change hostname du fichier awx.yaml
replace:
path: ~/tools/awx-on-k3s/base/awx.yaml
regexp: 'awx.example.com'
replace: '{{ awx_host }}'
backup: yes
- name: creation du repertoire postgres-13
ansible.builtin.file:
@@ -42,6 +55,17 @@
args:
chdir: "{{ awx_dir }}"
- name: Finalisation de l'installation awx
ansible.builtin.uri:
url: "http://s-awx.gsb.lan"
follow_redirects: none
method: GET
register: _result
until: _result.status == 200
retries: 90 # 90*10 seconds = 15 min
delay: 10 # Every 10 seconds