-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-vm.yml
47 lines (41 loc) · 1.07 KB
/
prepare-vm.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
---
- hosts: all
gather_facts: True
sudo: True
tasks:
- name: ensure required packages for prep are installed
apt:
pkg: "{{ item }}"
state: latest
update_cache: yes
cache_valid_time: 600
with_items:
- iptables-persistent
- name: enable net.ipv4.ip_forward in sysctl
sysctl:
name: net.ipv4.ip_forward
value: "1"
state: present
- name: check to see if masquerade rule is present...
command: iptables -t nat -C POSTROUTING -s 10.1.0.0/16 -o eth0 -j MASQUERADE
register: ipt_masquerade
ignore_errors: yes
changed_when: false
- name: add masquerade rule if not present...
shell: >
iptables -t nat -A POSTROUTING -s 10.1.0.0/16 -o eth0 -j MASQUERADE &&
invoke-rc.d iptables-persistent save
when: ipt_masquerade|failed
- hosts: all
gather_facts: True
sudo: True
vars_files:
- defaults/main.yml
roles:
- mysql
- rabbitmq-server
- keystone
- glance
- nova-controller
- neutron-controller
- neutron-network