jjb: Gently stop instances before publication
[lttng-ci.git] / automation / ansible / playbooks / post-imagebuild-clean.yml
CommitLineData
a2e5135c
KS
1---
2- hosts: all
3 tasks:
4 - when: ansible_os_family == 'Debian'
5 ansible.builtin.command:
6 argv: ['apt-get', 'clean']
7 - when: ansible_os_family == 'Suse'
8 ansible.builtin.command:
9 argv: ['zypper', 'clean']
10 - when: ansible_distribution == 'SLES'
11 block:
12 - ansible.builtin.command:
13 argv: ['SUSEConnect', '-d']
14 - ansible.builtin.command:
15 argv: ['SUSEConnect', '--cleanup']
16 - ansible.builtin.command:
17 argv: ['cloud-init', 'clean']
18 ignore_errors: true
953731b0
KS
19 - ansible.built.command:
20 argv: ['sync']
a2e5135c
KS
21 - ansible.builtin.shell:
22 cmd: 'history -cw'
8c849496
KS
23 # Some default shells don't have the `history` built-in,
24 # and it's not blocking that this works or not.
25 ignore_errors: true
a2e5135c
KS
26 - ansible.builtin.file:
27 path: /root/.ssh/authorized_keys2
28 state: absent
This page took 0.023343 seconds and 4 git commands to generate.