[add update]
This commit is contained in:
57
update.yml
57
update.yml
@@ -1,32 +1,25 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
# vars:
|
|
||||||
# become: true
|
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars:
|
become: true
|
||||||
user: staffadmin
|
|
||||||
username: jingohalert
|
|
||||||
password: !vault |
|
|
||||||
$ANSIBLE_VAULT;1.2;AES256;prod
|
|
||||||
66346630333538386564396632636161316239326530653037666465616165393135666532643264
|
|
||||||
3037363865363531636635306535663736353734333733340a363639636638396662616538343335
|
|
||||||
65366439343135636634393832636436353764303066653530346232323164376265313039373630
|
|
||||||
3863613961373430340a303866363962353262623030373061616134303366336237346631383539
|
|
||||||
3130
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
# stephane ALL=(ALL) NOPASSWD: ALL or need ansible_sudo_pass
|
# stephane ALL=(ALL) NOPASSWD: ALL or need ansible_sudo_pass
|
||||||
|
|
||||||
- apt:
|
- ansible.builtin.apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
become: true
|
|
||||||
# when:
|
|
||||||
# - inventory_hostname != 'scaleway'
|
|
||||||
|
|
||||||
|
- ansible.builtin.apt:
|
||||||
|
name: "*"
|
||||||
|
state: latest
|
||||||
|
|
||||||
- apt:
|
- ansible.builtin.apt:
|
||||||
upgrade: safe
|
upgrade: safe
|
||||||
become: true
|
|
||||||
|
- ansible.builtin.apt:
|
||||||
|
clean: yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# when:
|
# when:
|
||||||
# - inventory_hostname != 'scaleway'
|
# - inventory_hostname != 'scaleway'
|
||||||
|
|
||||||
@@ -50,19 +43,19 @@
|
|||||||
# - reboot_needed.stdout == "reboot_needed"
|
# - reboot_needed.stdout == "reboot_needed"
|
||||||
# become: true
|
# become: true
|
||||||
|
|
||||||
- uri:
|
# - uri:
|
||||||
url: "https://alert.jingoh.fr/scaleway"
|
# url: "https://alert.jingoh.fr/scaleway"
|
||||||
method: POST
|
# method: POST
|
||||||
user: "{{ username }}"
|
# user: "{{ username }}"
|
||||||
password: "{{ password }}"
|
# password: "{{ password }}"
|
||||||
headers:
|
# headers:
|
||||||
Title: "update {{ ansible_play_hosts }}"
|
# Title: "update {{ ansible_play_hosts }}"
|
||||||
ta: "file_folder"
|
# ta: "file_folder"
|
||||||
body: "Updated and Upgraded !"
|
# body: "Updated and Upgraded !"
|
||||||
status_code: 200
|
# status_code: 200
|
||||||
delegate_to: localhost
|
# delegate_to: localhost
|
||||||
tags: toto
|
# tags: toto
|
||||||
run_once: true
|
# run_once: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user