Debian Codegraph @

ansible_collections/community/proxysql/tests/integration/targets/setup_proxysql_v3/tasks/install.yml

raw
1 ---
2 - name: Override systemd unit for tests
3 vars:
4 proxysql_systemd_override_path: /etc/systemd/system/proxysql.service.d
5 block:
6 # In Ubuntu 24.04, the combination of `PrivateDevices` and
7 # `RestrictAddressFamilies` was leading to a need for the `CAP_SYS_ADMIN`
8 # capability within the `ansible-test` docker container. These stanzas
9 # within systemd are intended to sandbox processes, reducing the attack
10 # surface of units run within it.
11
12 # While I think both of these systemd stanzas may make sense for
13 # production deployments, I am not sure they make sense on ephemeral test
14 # containers --- especially if it requires additional system privileges by
15 # running the container in privileged mode.
16 - name: Create systemd override directory
17 ansible.builtin.file:
18 path: '{{ proxysql_systemd_override_path }}'
19 state: directory
20 owner: root
21 group: root
22 mode: '0755'
23 - name: Create systemd override file
24 ansible.builtin.copy:
25 dest: '{{ proxysql_systemd_override_path }}/docker-friendly-tests.conf'
26 owner: root
27 group: root
28 mode: '0644'
29 content: |
30 [Service]
31 PrivateDevices=no
32 RestrictAddressFamilies=
33 register: proxysql_systemd_override
34
35 - name: proxysql | install | add apt signing key for percona
36 apt_key:
37 keyserver: keyserver.ubuntu.com
38 id: 4D1BB29D63D98E422B2113B19334A25F8507EFA5
39 state: present
40
41 - name: proxysql | install | add percona repositories
42 apt_repository:
43 repo: "{{ item }}"
44 state: present
45 loop: "{{ proxysql_percona_mysql_repos }}"
46
47 - name: proxysql | install | install proxysql release
48 apt:
49 deb: "{{ proxysql_release }}"
50 state: present
51 register: proxysql_release_install
52
53 - name: proxysql | install | install packages required by proxysql
54 apt:
55 name: "{{ proxysql_percona_mysql_packages }}"
56 state: present
57 environment:
58 DEBIAN_FRONTEND: noninteractive
59
60 - name: proxysql | install | install python packages
61 pip:
62 name: "{{ proxysql_python_packages }}"