b9568850eda825913f3210b82d83e3405ac1ad41
[ci-management.git] / packer / provision / local-builder.yaml
1 ---
2 - import_playbook: ../common-packer/provision/baseline.yaml
3
4 - hosts: all
5   become_user: root
6   become_method: sudo
7
8   tasks:
9     - apt_repository:
10         repo: ppa:deadsnakes/ppa
11         state: present
12       become: true
13       when: ansible_distribution == 'Ubuntu'
14
15     - name: Update and upgrade apt packages
16       apt:
17         upgrade: 'yes'
18         update_cache: yes
19       become: true
20       when: ansible_distribution == 'Ubuntu'
21
22     - name: Install python-tox and deps
23       pip:
24         name:
25           - tox
26           - tox-pyenv
27         state: present
28       become: true
29
30     - name: Install Python 3.6 and packages
31       apt:
32         name:
33           - python3.6
34           - python3.6-dev
35           - python3.6-tk
36           - libssl-dev
37           - libmysqlclient-dev
38           - gcc
39           - python3-venv
40       become: true
41       when: ansible_distribution == 'Ubuntu'
42
43     - name: Install Python 3.7
44       apt:
45         name:
46           - python3.7
47           - python3.7-dev
48           - python3.7-tk
49       become: true
50       when: ansible_distribution == 'Ubuntu'
51
52     - name: Install Python 3.8
53       apt:
54         name:
55           - python3.8
56           - python3.8-dev
57           - python3.8-tk
58       become: true
59       when: ansible_distribution == 'Ubuntu'
60
61     - name: Install Python 3.9
62       apt:
63         name:
64           - python3.9
65           - python3.9-dev
66           - python3.9-tk
67           - python3.9-distutils
68       become: true
69       when: ansible_distribution == 'Ubuntu'
70
71     - name: Install libssl1.0-dev dep
72       apt:
73         name: libssl1.0-dev
74         update_cache: yes
75         state: fixed
76       become: true
77       when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
78
79     - name: Install nodejs-dev dep for npm
80       apt:
81         name: nodejs-dev
82         update_cache: yes
83         state: fixed
84       become: true
85       when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
86
87     - name: Install libnode-dev dep for npm
88       apt:
89         name: libnode-dev
90         update_cache: yes
91         state: fixed
92       become: true
93       when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
94
95     - name: Install supporting packages (Ubuntu 18.04)
96       apt:
97         name:
98           - unzip
99           - xz-utils
100           - libxml-xpath-perl
101           - wget
102           - make
103           - sshuttle
104           - netcat
105           - libssl-dev
106           - libffi-dev
107           - xmlstarlet
108           - xvfb
109           - crudini
110           - maven
111           - python-ncclient
112         update_cache: yes
113         state: fixed
114       become: true
115       when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
116
117     - name: Install supporting packages (Ubuntu 20.04)
118       apt:
119         name:
120           - unzip
121           - xz-utils
122           - libxml-xpath-perl
123           - wget
124           - make
125           - sshuttle
126           - netcat
127           - libssl-dev
128           - libffi-dev
129           - xmlstarlet
130           - xvfb
131           - crudini
132           - maven
133           - python3-ncclient
134         update_cache: yes
135         state: fixed
136       become: true
137       when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
138
139     - name: Install npm and addon packages
140       apt:
141         name:
142           - nodejs
143           - npm
144           - node-gyp
145         update_cache: yes
146         state: fixed
147       become: true
148       when: ansible_distribution == 'Ubuntu'
149
150