|
10 | 10 | - "gitlab_runner_ssh_private_key | default('') | length > 0" |
11 | 11 | block: |
12 | 12 | - name: "Place SSH public key on the host for communicating with Runners." |
| 13 | + become: true |
13 | 14 | ansible.builtin.copy: |
14 | 15 | src: "{{ gitlab_runner_ssh_public_key }}" |
15 | 16 | dest: "{{ gitlab_runner_ssh_public_key_path }}" |
|
18 | 19 | mode: "0644" |
19 | 20 |
|
20 | 21 | - name: "Place SSH private key on the host for communicating with Runners." |
| 22 | + become: true |
21 | 23 | ansible.builtin.copy: |
22 | 24 | src: "{{ gitlab_runner_ssh_private_key }}" |
23 | 25 | dest: "{{ gitlab_runner_ssh_private_key_path }}" |
|
26 | 28 | mode: "0600" |
27 | 29 |
|
28 | 30 | - name: "Create SSH key pair for communicating with Runners." |
| 31 | + become: true |
29 | 32 | community.crypto.openssh_keypair: # noqa: args[module] |
30 | 33 | path: "{{ gitlab_runner_ssh_private_key_path }}" |
31 | 34 | type: "{{ gitlab_runner_ssh_key_type | default('ed25519') }}" |
32 | 35 | register: "__gitlab_runner_ssh_keypair" |
33 | 36 | when: "not __gitlab_runner_is_initial_dryrun" # skip if run for the first time in check mode |
34 | 37 |
|
35 | 38 | - name: "Download and install container-linux-config-transpiler" |
| 39 | + become: true |
36 | 40 | ansible.builtin.get_url: |
37 | 41 | url: "{{ gitlab_runner_transpiler_binary_url }}" |
38 | 42 | dest: "/usr/local/bin/butane" |
39 | 43 | mode: "0755" |
40 | 44 | checksum: "{{ gitlab_runner_transpiler_binary_checksum }}" |
41 | 45 |
|
42 | 46 | - name: "Place the container linux configuration on the host" |
| 47 | + become: true |
43 | 48 | ansible.builtin.template: |
44 | 49 | src: "{{ gitlab_runner_butane_config_template }}" |
45 | 50 | dest: "/etc/gitlab-runner/butane-config.bu" |
|
52 | 57 | - "Transpile the flatcar linux configuration" |
53 | 58 |
|
54 | 59 | - name: "Check if ignition.json is available and create it in any case" |
| 60 | + become: true |
55 | 61 | when: "not __flatcar_config_task.changed" # noqa no-handler |
56 | 62 | ansible.builtin.stat: |
57 | 63 | path: "/etc/gitlab-runner/ignition.json" |
|
77 | 83 | check_mode: false |
78 | 84 |
|
79 | 85 | - name: "Dry-run of transpile the flatcar linux configuration" |
| 86 | + become: true |
80 | 87 | ansible.builtin.command: "butane -o {{ (__temp_directory.path, 'ignition.json') | path_join }} /etc/gitlab-runner/butane-config.bu" |
81 | 88 | changed_when: false |
82 | 89 | check_mode: false |
83 | 90 |
|
84 | 91 | - name: "Stat temporary ignition.json file" |
| 92 | + become: true |
85 | 93 | ansible.builtin.stat: |
86 | 94 | path: "{{ (__temp_directory.path, 'ignition.json') | path_join }}" |
87 | 95 | register: "__temp_ignition_stats" |
|
0 commit comments