26 lines
711 B
YAML
26 lines
711 B
YAML
---
|
|
- name: Temporarily move cloud-agent and restore it
|
|
hosts: all
|
|
gather_facts: no
|
|
|
|
tasks:
|
|
- name: Move /tmp/launchd/services/cloud-agent to /root/
|
|
ansible.builtin.raw: |
|
|
set -e
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
|
|
mv -f /tmp/launchd/services/cloud-agent /root/
|
|
register: move_out
|
|
changed_when: true
|
|
|
|
- name: Wait 3s before restoring
|
|
ansible.builtin.pause:
|
|
seconds: 300
|
|
|
|
- name: Move /root/cloud-agent back to /tmp/launchd/services/
|
|
ansible.builtin.raw: |
|
|
set -e
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
|
|
mv -f /root/cloud-agent /tmp/launchd/services/
|
|
register: move_back
|
|
changed_when: true
|