Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grunt work to make it work again #7

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ executable = /bin/bash
; set inventory here, or on the command-line when running Ansible.
; dev is for Vagrant VirtualBox on Mac
; local is for localhost, assuming AlmaLinux or Rocky
inventory = inventory/dev/hosts
inventory = inventory/local/hosts

; Vagrant hosts are ephemeral set to true when promoting beyond test.
host_key_checking = False
Expand Down
4 changes: 3 additions & 1 deletion roles/api/tasks/credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@
when:
- "semaphore_keystores.json | selectattr('name', 'equalto', 'Controller-ssh-key') | length == 0"

- name: "Semaphore | Read ssh key from system"
- name: "Read ssh key from system"
delegate_to: localhost
connection: local
become: false
no_log: "{{ not debug }}"
ansible.builtin.slurp:
path: "{{ my_github_key }}"
register: "ssh_key_github"
failed_when: false

- name: "Create SSH key for GitHub"
changed_when: "semaphore_key_github_created.status == 204"
Expand All @@ -78,4 +79,5 @@
timeout: 5
register: semaphore_key_github_created
when:
- "'file not found' not in ssh_key_github.msg"
- "semaphore_keystores.json | selectattr('name', 'equalto', 'github-ssh-key') | length == 0"
1 change: 1 addition & 0 deletions roles/semaphore/tasks/present.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
loop:
- requirements.txt
- requirements.yml
- collections.yml

- name: Deploy Semaphore Config
become: true
Expand Down
2 changes: 1 addition & 1 deletion roles/semaphore/templates/semaphore.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SyslogIdentifier=semaphore

ExecStartPre=/bin/bash -c 'pip3.12 install --upgrade --user -r /home/semaphore/requirements.txt'
ExecStartPre=/bin/bash -c 'ansible-galaxy collection install --upgrade -r /home/semaphore/collections.yml'
ExecStartPre=/bin/bash -c 'ansible-galaxy install --upgrade -r /home/semaphore/requirements.yml'
ExecStartPre=/bin/bash -c 'ansible-galaxy install -r /home/semaphore/requirements.yml'

[Install]
WantedBy=multi-user.target