blob: 917cb630e90053ea0ec3af8810b1dd4801bd0c46 [file] [log] [blame]
Oleksandr Kozachenkob0093492023-09-06 21:43:47 +02001# Copyright (c) 2023 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15- hosts: all
16 become: true
17 pre_tasks:
18 - name: Wait for systemd to complete initialization
19 ansible.builtin.command: systemctl is-system-running
20 register: systemctl_status
21 until: >
22 'running' in systemctl_status.stdout or
23 'degraded' in systemctl_status.stdout
24 retries: 30
25 delay: 5
26 changed_when: false
27 failed_when: systemctl_status.rc > 1
28
29 # TODO(mnaser): We should really just build our own image, since the base
30 # images we use are missing a whole bunch of dependencies
31 # and need to download a lot of things online.
32 - name: Fix Python installation
33 block:
34 - name: Get all Python packages
35 ansible.builtin.command: pip freeze
36 register: pip_freeze
37
38 - name: Uninstall all Python packages
39 ansible.builtin.pip:
40 name: "{{ pip_freeze.stdout_lines }}"
41 state: absent
42 tasks:
43 - name: Refresh cache & install "iptables"
44 ansible.builtin.package:
45 name: iptables
46 update_cache: true