main.yml
1.55 KB
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
51
52
53
54
55
- name: Remove lxc default config
become: yes
file: path=/etc/lxc/default.conf state=absent
- name: Copy default lxc file
become: yes
copy:
src: files/default.conf
dest: /etc/lxc/default.conf
mode: 644
- name: Create onos1 container
lxc_container:
name: onos1
container_log: true
template: ubuntu
state: started
template_options: --release trusty
container_config:
- "lxc.network.ipv4=10.100.198.201/24"
container_command: |
ln -s /usr/lib/jvm/java/bin/java /usr/bin/java
apt-get update
apt-get install -y openssh-server
echo "ubuntu ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/99-onos-sudoers
- name: Create onos2 container
lxc_container:
name: onos2
container_log: true
template: ubuntu
state: started
template_options: --release trusty
container_config:
- "lxc.network.ipv4=10.100.198.202/24"
container_command: |
ln -s /usr/lib/jvm/java/bin/java /usr/bin/java
apt-get update
apt-get install -y openssh-server
echo "ubuntu ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/99-onos-sudoers
- name: Create onos3 container
lxc_container:
name: onos3
container_log: true
template: ubuntu
state: started
template_options: --release trusty
container_config:
- "lxc.network.ipv4=10.100.198.203/24"
container_command: |
ln -s /usr/lib/jvm/java/bin/java /usr/bin/java
apt-get update
apt-get install -y openssh-server
echo "ubuntu ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/99-onos-sudoers