Files
semaphore/update.yml
2025-07-28 22:33:47 +02:00

66 lines
1.8 KiB
YAML

- hosts: all
gather_facts: false
become: true
tasks:
# stephane ALL=(ALL) NOPASSWD: ALL or need ansible_sudo_pass
- ansible.builtin.apt:
update_cache: yes
- ansible.builtin.apt:
name: "*"
state: latest
- ansible.builtin.apt:
upgrade: safe
- ansible.builtin.apt:
clean: yes
# 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