-
Notifications
You must be signed in to change notification settings - Fork 0
/
atm-early.yml
50 lines (50 loc) · 1.47 KB
/
atm-early.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
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- hosts: Acme1ACI2
force_handlers: true
vars:
dev: legacy0
ints: '{{ tst.ints[1:] | selectattr("device", "eq", dev ) | first }}'
tasks:
- name: Disable cloud-init service in easy way
copy: # touch idempotently
content: ""
dest: /etc/cloud/cloud-init.disabled
force: no
group: cloud
owner: root
mode: 0644
- block:
- command: ip a add {{ ints.address }}/{{ ints.netmask }} dev {{ dev }}
- command: ip l set {{ dev }} up
- command: ip r add default via 192.168.0.1
notify: clean and down dev
- blockinfile: # or lineinfile for single line:
path: /etc/resolv.conf
block: |-
nameserver 192.168.254.10
nameserver 192.168.254.11
- lineinfile:
path: /etc/ostree/remotes.d/centos-atomic-host.conf
line: proxy={{ proxyenv.http_proxy }}
- atomic_host:
revision: latest
#environment: '{{ proxyenv }}' does not seem to be used
- lineinfile:
path: /etc/sysconfig/docker
line: HTTPS_PROXY={{ proxyenv.http_proxy }}
notify: restart docker
- docker_image:
name: networkstatic/iperf3
- copy:
src: pipework/pipework
dest: /usr/local/bin
mode: preserve
handlers:
- name: clean and down dev
- shell: |-
ip a flush {{ dev }}
ip l set {{ dev }} down
- name: restart docker
service:
name: docker
state: restarted