-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.yml
71 lines (56 loc) · 2.53 KB
/
install.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
- hosts: localhost
tasks:
- name: updates apt
apt:
update_cache: yes
- name: install basic packages
apt:
name: [
'aptitude', 'apt-transport-https', 'ca-certificates',
'curl', 'python3-setuptools', 'python3-dev', 'build-essential',
'python3-pip','iptables','software-properties-common'
]
state: present
- name: "Check if Docker-CE is installed"
package_facts:
manager: "auto"
- name: Add Docker CE repository key
shell: "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
when: "'docker-ce' not in ansible_facts.packages and 'moby-engine' not in ansible_facts.packages"
- name: Check system architecture
shell: "dpkg --print-architecture"
register: arch
when: "'docker-ce' not in ansible_facts.packages and 'moby-engine' not in ansible_facts.packages"
- name: Check OS Codename
shell: "lsb_release -cs"
register: codename
when: "'docker-ce' not in ansible_facts.packages and 'moby-engine' not in ansible_facts.packages"
- name: Install Docker CE repository
apt_repository:
repo: "deb [arch={{arch.stdout}} signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu {{codename.stdout}} stable"
filename: "docker"
when: "'docker-ce' not in ansible_facts.packages and 'moby-engine' not in ansible_facts.packages"
- name: install Docker CE
apt: name=docker-ce state=present
when: "'docker-ce' not in ansible_facts.packages and 'moby-engine' not in ansible_facts.packages"
- name: find pip executable
shell: "which pip3"
register: pip_path
- name: install python-backports.ssl-match-hostname
pip: name=backports.ssl-match-hostname executable={{pip_path.stdout}}
- name: install pytest
pip: name=pytest version=4.6.4 executable={{pip_path.stdout}}
- name: install docker py
pip: name=docker version=4.4.1 executable={{pip_path.stdout}}
- name: install python-iptables
pip: name=python-iptables state=latest executable={{pip_path.stdout}}
- name: install pexpect
pip: name=pexpect executable={{pip_path.stdout}}
- name: build and install Containernet (using Mininet installer)
shell: PYTHON=python3 containernet/util/install.sh -fnv
args:
chdir: ../../
- name: install Containernet Python egg etc.
shell: make -f Makefile develop
args:
chdir: ../