Skip to content

Commit

Permalink
Merge pull request #4 from MonolithProjects/develop
Browse files Browse the repository at this point in the history
Fix ansible lints

Former-commit-id: b25475f
  • Loading branch information
MonolithProjects authored Mar 23, 2020
2 parents 5fc33c1 + f052748 commit 526a863
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
13 changes: 0 additions & 13 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
user: ansible
hosts: all
become: yes
vars:
- runner_user: ansible
- github_repo: ansible-github_actions_runner-testrepo
- github_account: monolithprojects
roles:
- role: ansible-github_actions_runner

- name: Uninstall
user: ansible
hosts: all
become: yes
tags:
- uninstall
vars:
- runner_user: ansible
- github_repo: ansible-github_actions_runner-testrepo
Expand Down
5 changes: 3 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ platforms:
# pre_build_image: yes
provisioner:
name: ansible
playbooks:
converge: converge.yml
cleanup: cleanup.yml
log: false
# env:
# PERSONAL_ACCESS_TOKEN: $PERSONAL_ACCESS_TOKEN
inventory:
host_vars:
CentOS8:
Expand Down
10 changes: 6 additions & 4 deletions tasks/install_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@
- install

- name: Register runner
command: "{{ runner_dir }}/./config.sh --url {{ github_server }}/{{ github_account }}/{{ github_repo }} --token {{ registration.json.token }} --unattended"
command: "{{ runner_dir }}/./config.sh --url {{ github_server }}/{{ github_account }}/{{ github_repo }} \
--token {{ registration.json.token }} --unattended"
args:
chdir: "{{ runner_dir }}"
# became: yes
become: yes
become_user: "{{ runner_user }}"
no_log: "{{ hide_sensitive_logs }}"
when: ansible_hostname not in registered_runners.json.runners|map(attribute='name')|list
tags:
- install

- name: Replace registered runner
command: "{{ runner_dir }}/config.sh --url {{ github_server }}/{{ github_account }}/{{ github_repo }} --token {{ registration.json.token }} --unattended --replace"
command: "{{ runner_dir }}/config.sh --url {{ github_server }}/{{ github_account }}/{{ github_repo }} \
--token {{ registration.json.token }} --unattended --replace"
args:
chdir: "{{ runner_dir }}"
# became: yes
become: yes
become_user: "{{ runner_user }}"
no_log: "{{ hide_sensitive_logs }}"
when: replace_runner and ansible_hostname in registered_runners.json.runners|map(attribute='name')|list
Expand Down
1 change: 1 addition & 0 deletions tasks/uninstall_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
command: "./config.sh remove --token {{ registration.json.token }} --unattended"
args:
chdir: "{{ runner_dir }}"
become: yes
become_user: "{{ runner_user }}"
no_log: "{{ hide_sensitive_logs }}"
when: ansible_hostname in registered_runners.json.runners|map(attribute='name')|list and runner_file.stat.exists
Expand Down

0 comments on commit 526a863

Please sign in to comment.