Compare commits

..

2 Commits

Author SHA1 Message Date
88061eb89d reorganisation du role s-awx et s-awx-post 2024-01-30 11:55:30 +01:00
6fbad9d9fa MAJ role AWX 2024-01-30 11:38:16 +01:00
8 changed files with 47 additions and 117 deletions

View File

@ -1,20 +0,0 @@
---
- name: Creation user awx
ansible.builtin.user:
name: awx
groups: sudo
append: yes
shell: /bin/bash
- name: Get awx key_pub
get_url:
url: s-adm.gsb.adm/gsbstore/id_rsa_awx.pub
dest: /tmp
- name: Set authorized key taken from file /tmp
ansible.posix.authorized_key:
user: awx
state: present
key: "{{ lookup('file', '/tmp/id_rsa_awx.pub') }}"

View File

@ -1,14 +0,0 @@
---
- name: Creation user awx, cle SSH et group sudo
ansible.builtin.user:
name: awx
groups: sudo
append: yes
shell: /bin/bash
generate_ssh_key: yes
- name: Copie cle publique dans gsbstore
copy:
src: /home/awx/.ssh/id_rsa.pub
dest: /var/www/html/gsbstore/id_rsa_awx.pub
remote_src: yes

View File

@ -1,8 +0,0 @@
#variable kea
kea_ver: "2.4.1"
kea_dbname: ""
kaa_dbuser: ""
kea_dbpasswd: ""
kea_dhcp4_dir: "/etc/kea/kea-dhcp4.conf"
kea_ctrl_dir: "/etc/kea/kea-ctrl-agent.conf"

View File

@ -1,6 +0,0 @@
---
- name: Restart isc-stork-server.service
ansible.builtin.service:
name: isc-stork-server.service
state: restarted
enabled: yes

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

View File

@ -1,52 +0,0 @@
### database settings
### the address of a PostgreSQL database
STORK_DATABASE_HOST=localhost
### the port of a PostgreSQL database
STORK_DATABASE_PORT=5432
### the name of a database
STORK_DATABASE_NAME={{ stork_db_name }}
### the username for connecting to the database
STORK_DATABASE_USER_NAME={{ stork_db_user }}
### the SSL mode for connecting to the database
### possible values: disable, require, verify-ca, or verify-full
# STORK_DATABASE_SSLMODE=
### the location of the SSL certificate used by the server to connect to the database
# STORK_DATABASE_SSLCERT=
### the location of the SSL key used by the server to connect to the database
# STORK_DATABASE_SSLKEY=
### the location of the root certificate file used to verify the database server's certificate
# STORK_DATABASE_SSLROOTCERT=
### the password for the username connecting to the database
### empty password is set to avoid prompting a user for database password
STORK_DATABASE_PASSWORD={{stork_db_passwd }}
### REST API settings
### the IP address on which the server listens
# STORK_REST_HOST=
### the port number on which the server listens
# STORK_REST_PORT=
### the file with a certificate to use for secure connections
# STORK_REST_TLS_CERTIFICATE=
### the file with a private key to use for secure connections
# STORK_REST_TLS_PRIVATE_KEY=
### the certificate authority file used for mutual TLS authentication
# STORK_REST_TLS_CA_CERTIFICATE=
### the directory with static files served in the UI
STORK_REST_STATIC_FILES_DIR=/usr/share/stork/www
### the base URL of the UI - to be used only if the UI is served from a subdirectory
# STORK_REST_BASE_URL=
### enable Prometheus /metrics HTTP endpoint for exporting metrics from
### the server to Prometheus. It is recommended to secure this endpoint
### (e.g. using HTTP proxy).
# STORK_SERVER_ENABLE_METRICS=true
### Logging parameters
### Set logging level. Supported values are: DEBUG, INFO, WARN, ERROR
# STORK_LOG_LEVEL=DEBUG
### disable output colorization
# CLICOLOR=false
### path to the hook directory
# STORK_SERVER_HOOK_DIRECTORY=

11
s-awx-post.yml Normal file
View File

@ -0,0 +1,11 @@
---
- hosts: localhost
connection: local
vars:
awx_host: "s-awx.gsb.lan"
awx_dir: "/root/tools/awx-on-k3s"
awx_ip: "172.16.0.22"
awx_if: "enp0s8"
roles:
- awx

View File

@ -2,16 +2,11 @@
- hosts: localhost
connection: local
vars:
awx_host: "s-awx.gsb.lan"
awx_dir: "/root/tools/awx-on-k3s"
awx_ip: "192.168.0.2"
awx_if: "enp0s3"
roles:
- base
# - goss
#- ssh-cli
- awx
- goss
- ssh-cli
#- awx
# - zabbix-cli
#- journald-snd
#- post
- journald-snd
- post