|
1 | 1 | - name: AWS CLI dep |
2 | | - apt: |
| 2 | + ansible.builtin.apt: |
| 3 | + install_recommends: false |
3 | 4 | pkg: |
4 | | - - unzip |
5 | 5 | - jq |
6 | | - install_recommends: no |
| 6 | + - unzip |
7 | 7 |
|
8 | | -- name: AWS CLI (arm) |
9 | | - get_url: |
10 | | - url: "https://awscli.amazonaws.com/awscli-exe-linux-aarch64-{{ aws_cli_release }}.zip" |
11 | | - dest: "/tmp/awscliv2.zip" |
| 8 | +- name: AWS CLI - get |
| 9 | + ansible.builtin.get_url: |
| 10 | + dest: '/tmp/awscliv2.zip' |
12 | 11 | timeout: 60 |
13 | | - when: platform == "arm64" |
| 12 | + url: "https://awscli.amazonaws.com/awscli-exe-linux-{{ 'aarch64' if platform == 'arm64' else 'x86_64' }}-{{ aws_cli_release }}.zip" |
14 | 13 |
|
15 | | -- name: AWS CLI (x86) |
16 | | - get_url: |
17 | | - url: "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-{{ aws_cli_release }}.zip" |
18 | | - dest: "/tmp/awscliv2.zip" |
19 | | - timeout: 60 |
20 | | - when: platform == "amd64" |
21 | 14 |
|
22 | 15 | - name: AWS CLI - expand |
23 | | - unarchive: |
24 | | - remote_src: yes |
25 | | - src: "/tmp/awscliv2.zip" |
26 | | - dest: "/tmp" |
| 16 | + ansible.builtin.unarchive: |
| 17 | + dest: '/tmp' |
| 18 | + remote_src: true |
| 19 | + src: '/tmp/awscliv2.zip' |
27 | 20 |
|
28 | 21 | - name: AWS CLI - install |
29 | | - shell: "/tmp/aws/install --update" |
| 22 | + ansible.builtin.command: |
| 23 | + cmd: /tmp/aws/install --update |
30 | 24 | become: true |
31 | 25 |
|
32 | 26 | - name: install utilities to manage Amazon EC2 instance storage |
33 | | - become: true |
34 | | - apt: |
| 27 | + ansible.builtin.apt: |
35 | 28 | pkg: |
36 | 29 | - amazon-ec2-utils |
| 30 | + become: true |
37 | 31 |
|
38 | 32 | - name: AWS CLI - configure ipv6 support for s3 |
39 | | - shell: | |
40 | | - aws configure set default.s3.use_dualstack_endpoint true |
| 33 | + ansible.builtin.command: |
| 34 | + cmd: aws configure set default.s3.use_dualstack_endpoint true |
41 | 35 |
|
42 | 36 | - name: install Vector for logging |
43 | | - become: true |
44 | 37 | apt: |
45 | | - deb: "{{ vector_x86_deb }}" |
46 | | - when: platform == "amd64" |
47 | | - |
48 | | -- name: install Vector for logging |
| 38 | + deb: "{{ vector_x86_deb if platform == 'amd64' else vector_arm_deb }}" |
49 | 39 | become: true |
50 | | - apt: |
51 | | - deb: "{{ vector_arm_deb }}" |
52 | | - when: platform == "arm64" |
53 | 40 |
|
54 | 41 | - name: add Vector to postgres group |
| 42 | + ansible.builtin.user: |
| 43 | + append: true |
| 44 | + groups: 'postgres' |
| 45 | + name: 'vector' |
55 | 46 | become: true |
56 | | - shell: |
57 | | - cmd: | |
58 | | - usermod -a -G postgres vector |
59 | 47 |
|
60 | 48 | - name: create service files for Vector |
61 | | - template: |
62 | | - src: files/vector.service.j2 |
63 | | - dest: /etc/systemd/system/vector.service |
| 49 | + ansible.builtin.template: |
| 50 | + src: 'files/vector.service.j2' |
| 51 | + dest: '/etc/systemd/system/vector.service' |
64 | 52 |
|
65 | 53 | - name: configure tmpfiles for postgres - overwrites upstream package |
66 | | - template: |
67 | | - src: files/postgresql_config/tmpfiles.postgresql.conf |
68 | | - dest: /etc/tmpfiles.d/postgresql-common.conf |
| 54 | + ansible.builtin.template: |
| 55 | + src: 'files/postgresql_config/tmpfiles.postgresql.conf' |
| 56 | + dest: '/etc/tmpfiles.d/postgresql-common.conf' |
69 | 57 |
|
70 | 58 | - name: fix permissions for vector config to be managed |
71 | | - shell: |
72 | | - cmd: | |
73 | | - chown -R vector:vector /etc/vector |
74 | | - chmod 0775 /etc/vector |
| 59 | + ansible.builtin.file: |
| 60 | + group: 'vector' |
| 61 | + mode: '0775' |
| 62 | + owner: 'vector' |
| 63 | + path: '/etc/vector' |
| 64 | + recurse: true |
| 65 | + state: 'directory' |
75 | 66 |
|
76 | 67 | - name: vector - reload systemd |
77 | | - systemd: |
78 | | - daemon_reload: yes |
| 68 | + ansible.builtin.systemd_service: |
| 69 | + daemon_reload: true |
79 | 70 |
|
80 | 71 | - name: Create checkpoints dir |
| 72 | + ansible.builtin.file: |
| 73 | + owner: 'vector' |
| 74 | + path: '/var/lib/vector' |
| 75 | + state: 'directory' |
81 | 76 | become: true |
82 | | - file: |
83 | | - path: /var/lib/vector |
84 | | - state: directory |
85 | | - owner: vector |
86 | 77 |
|
87 | 78 | - name: Include file for generated optimizations in postgresql.conf |
88 | | - become: true |
89 | | - replace: |
90 | | - path: /etc/postgresql/postgresql.conf |
| 79 | + ansible.builtin.replace: |
| 80 | + path: '/etc/postgresql/postgresql.conf' |
91 | 81 | regexp: "#include = '/etc/postgresql-custom/generated-optimizations.conf'" |
92 | 82 | replace: "include = '/etc/postgresql-custom/generated-optimizations.conf'" |
| 83 | + become: true |
93 | 84 |
|
94 | 85 | - name: Include file for custom overrides in postgresql.conf |
95 | | - become: true |
96 | | - replace: |
97 | | - path: /etc/postgresql/postgresql.conf |
| 86 | + ansible.builtin.replace: |
| 87 | + path: '/etc/postgresql/postgresql.conf' |
98 | 88 | regexp: "#include = '/etc/postgresql-custom/custom-overrides.conf'" |
99 | 89 | replace: "include = '/etc/postgresql-custom/custom-overrides.conf'" |
| 90 | + become: true |
100 | 91 |
|
101 | 92 | - name: Install Postgres exporter |
102 | | - import_tasks: internal/postgres-exporter.yml |
| 93 | + ansible.builtin.import_tasks: |
| 94 | + file: internal/postgres-exporter.yml |
103 | 95 |
|
104 | 96 | - name: Install admin-mgr |
105 | | - import_tasks: internal/admin-mgr.yml |
| 97 | + ansible.builtin.import_tasks: |
| 98 | + file: internal/admin-mgr.yml |
106 | 99 |
|
107 | 100 | - name: Install adminapi |
108 | | - import_tasks: internal/admin-api.yml |
| 101 | + ansible.builtin.import_tasks: |
| 102 | + file: internal/admin-api.yml |
109 | 103 |
|
110 | 104 | - name: Init nftabless |
111 | | - import_tasks: internal/setup-nftables.yml |
| 105 | + ansible.builtin.import_tasks: |
| 106 | + file: internal/setup-nftables.yml |
112 | 107 |
|
113 | 108 | - name: Install pg_egress_collect |
114 | | - import_tasks: internal/pg_egress_collect.yml |
| 109 | + ansible.builtin.import_tasks: |
| 110 | + file: internal/pg_egress_collect.yml |
115 | 111 |
|
116 | 112 | - name: Install PostgreSQL prestart script |
117 | | - import_tasks: internal/postgresql-prestart.yml |
| 113 | + ansible.builtin.import_tasks: |
| 114 | + file: internal/postgresql-prestart.yml |
118 | 115 |
|
119 | 116 | - name: Install salt minion |
120 | | - import_tasks: internal/install-salt.yml |
| 117 | + ansible.builtin.import_tasks: |
| 118 | + file: internal/install-salt.yml |
121 | 119 | tags: |
122 | 120 | - aws-only |
123 | 121 |
|
124 | 122 | - name: Install supabase-admin-agent |
125 | | - import_tasks: internal/supabase-admin-agent.yml |
| 123 | + ansible.builtin.import_tasks: |
| 124 | + file: internal/supabase-admin-agent.yml |
126 | 125 | tags: |
127 | 126 | - aws-only |
128 | 127 |
|
129 | 128 | - name: Envoy - use lds.supabase.yaml for /etc/envoy/lds.yaml |
130 | | - command: mv /etc/envoy/lds.supabase.yaml /etc/envoy/lds.yaml |
| 129 | + ansible.builtin.command: |
| 130 | + cmd: mv /etc/envoy/lds.supabase.yaml /etc/envoy/lds.yaml |
0 commit comments