|
41 | 41 | tags:
|
42 | 42 | - install
|
43 | 43 |
|
44 |
| -- name: Create temporary directory for archive |
| 44 | +- name: Create temporary directory for archive |
45 | 45 | file:
|
46 | 46 | path: "{{ runner_pkg_tempdir }}"
|
47 | 47 | state: directory
|
|
56 | 56 |
|
57 | 57 | - name: Download runner package version - "{{ runner_version }}" (RUN ONCE)
|
58 | 58 | get_url:
|
59 |
| - url: "https://github.com/{{ runner_download_repository }}/releases/download/v{{ runner_version }}/\ |
60 |
| - actions-runner-linux-{{ github_actions_architecture }}-{{ runner_version }}.tar.gz" |
| 59 | + url: |
| 60 | + "https://github.com/{{ runner_download_repository }}/releases/download/v{{ runner_version }}/\ |
| 61 | + actions-runner-linux-{{ github_actions_architecture }}-{{ runner_version }}.tar.gz" |
61 | 62 | dest: "{{ runner_pkg_tempdir }}/actions-runner-linux-{{ runner_version }}.tar.gz"
|
62 | 63 | force: no
|
63 | 64 | run_once: yes
|
|
77 | 78 | tags:
|
78 | 79 | - install
|
79 | 80 |
|
| 81 | +- name: Configure custom env file if required |
| 82 | + blockinfile: |
| 83 | + path: "{{ runner_dir }}/.env" |
| 84 | + block: "{{ custom_env }}" |
| 85 | + owner: "{{ runner_user }}" |
| 86 | + create: yes |
| 87 | + mode: 0755 |
| 88 | + marker_begin: "# BEGIN ANSIBLE MANAGED BLOCK" |
| 89 | + marker_end: "# END ANSIBLE MANAGED BLOCK" |
| 90 | + when: custom_env is defined |
| 91 | + |
80 | 92 | - name: Register runner (if new installation) for repo
|
81 |
| - command: "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \ |
82 |
| - --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended \ |
83 |
| - {{ runner_extra_config_args }}" |
| 93 | + command: |
| 94 | + "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \ |
| 95 | + --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended \ |
| 96 | + {{ runner_extra_config_args }}" |
84 | 97 | args:
|
85 | 98 | chdir: "{{ runner_dir }}"
|
86 | 99 | become: yes
|
|
91 | 104 | - install
|
92 | 105 |
|
93 | 106 | - name: Register runner (if new installation) for organization
|
94 |
| - command: "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }} \ |
95 |
| - --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended" |
| 107 | + command: |
| 108 | + "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }} \ |
| 109 | + --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended" |
96 | 110 | args:
|
97 | 111 | chdir: "{{ runner_dir }}"
|
98 | 112 | become: yes
|
|
103 | 117 | - install
|
104 | 118 |
|
105 | 119 | - name: Replace registered runner for repo
|
106 |
| - command: "{{ runner_dir }}/config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \ |
107 |
| - --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended --replace" |
| 120 | + command: |
| 121 | + "{{ runner_dir }}/config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \ |
| 122 | + --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended --replace" |
108 | 123 | args:
|
109 | 124 | chdir: "{{ runner_dir }}"
|
110 | 125 | become: yes
|
|
115 | 130 | - install
|
116 | 131 |
|
117 | 132 | - name: Replace registered runner for organization
|
118 |
| - command: "{{ runner_dir }}/config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }} \ |
119 |
| - --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended --replace" |
| 133 | + command: |
| 134 | + "{{ runner_dir }}/config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }} \ |
| 135 | + --token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended --replace" |
120 | 136 | args:
|
121 | 137 | chdir: "{{ runner_dir }}"
|
122 | 138 | become: yes
|
|
0 commit comments