-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiskEx.yml
37 lines (34 loc) · 1.13 KB
/
diskEx.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- name: "VM LVM Extend With fsextender"
hosts: all
connection: paramiko
vars:
ansible_paramiko_user: "{{ usrR }}"
ansible_paramiko_pass: "{{ passR }}"
tasks:
- name: Get fsextender
get_url:
url: "http://176.32.192.110/fsextender.tar.gz"
dest: "/opt/fsextender.tar.gz"
mode: 0755
- shell: tar -xzvf /opt/fsextender.tar.gz -C /opt
- shell: df -ah | grep '/dev/mapper/*' | awk 'BEGIN {FS=" "}{print $1}'
register: myDF
- set_fact:
myDFfs={{ myDF.stdout }}
- shell: /opt/fsextender --do {{myDFfs}}
- ipify_facts:
# - debug:
# msg: "{{ipify_public_ip }}"
- name: Reboot node and stop polling.
shell: reboot
async: 10 # Do not care for 10 sec
poll: 0 # Fire & Forget
- name: "Wait for reboot"
local_action: wait_for host={{ ansible_default_ipv4.address }} port=22 delay=10 state=started
become: false
- name: Check the uptime post reboot
shell: uptime
register: UPTIME_POST_REBOOT
- debug: msg={{UPTIME_POST_REBOOT.stdout}}
- shell: /opt/fsextender --do {{myDFfs}}