71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
- hosts: all
|
|
# vars:
|
|
# become: true
|
|
gather_facts: false
|
|
vars:
|
|
user: staffadmin
|
|
username: jingohalert
|
|
password: !vault |
|
|
$ANSIBLE_VAULT;1.2;AES256;prod
|
|
66346630333538386564396632636161316239326530653037666465616165393135666532643264
|
|
3037363865363531636635306535663736353734333733340a363639636638396662616538343335
|
|
65366439343135636634393832636436353764303066653530346232323164376265313039373630
|
|
3863613961373430340a303866363962353262623030373061616134303366336237346631383539
|
|
3130
|
|
|
|
tasks:
|
|
|
|
- apt:
|
|
update_cache: yes
|
|
become: true
|
|
when:
|
|
- inventory_hostname != 'scaleway'
|
|
|
|
|
|
- apt:
|
|
upgrade: full
|
|
become: true
|
|
when:
|
|
- inventory_hostname != 'scaleway'
|
|
|
|
|
|
- community.docker.docker_compose_v2:
|
|
project_src: /opt/dockerapps/
|
|
pull: always
|
|
when:
|
|
- inventory_hostname == 'scaleway'
|
|
|
|
- shell: "if [ $(ls /var/run/reboot* 2>/dev/null | wc -l) -gt 0 ]; then echo 'reboot_needed'; fi"
|
|
register: reboot_needed
|
|
changed_when: reboot_needed.stdout == "reboot_needed"
|
|
failed_when: false
|
|
when:
|
|
- inventory_hostname != 'scaleway'
|
|
|
|
- reboot:
|
|
when:
|
|
- inventory_hostname != 'scaleway'
|
|
- reboot_needed.stdout == "reboot_needed"
|
|
become: true
|
|
|
|
- uri:
|
|
url: "https://alert.jingoh.fr/scaleway"
|
|
method: POST
|
|
user: "{{ username }}"
|
|
password: "{{ password }}"
|
|
headers:
|
|
Title: "update {{ ansible_play_hosts }}"
|
|
ta: "file_folder"
|
|
body: "Updated and Upgraded !"
|
|
status_code: 200
|
|
delegate_to: localhost
|
|
tags: toto
|
|
run_once: true
|
|
|
|
|
|
|
|
# flux create source git podinfo --url=https://gitea.jingoh.fr/staffadmin/cluster --branch=master --interval=1m --export > /kubernetes/podinfo-source.yaml
|
|
# zsh: no such file or directory: /kubernetes/podinfo-source.yaml
|
|
|
|
# flux create kustomization podinfo --target-namespace=default --source=podinfo --path="./kustomize" --prune=true --wait=true --interval=30m --retry-interval=2m --health-check-timeout=3m --export > ./kubernetes/podinfo-kustomization.yaml
|