forked from bbaassssiiee/controller
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a90deca
commit b067ae7
Showing
18 changed files
with
212 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
--- | ||
semaphore_download_url: 'https://github.com/semaphoreui/semaphore/releases/download/v2.10.35/semaphore_2.10.35_linux_amd64.tar.gz' | ||
semaphore_download_binary: false | ||
#semaphore_download_url: 'https://github.com/semaphoreui/semaphore/releases/download/v2.10.35/semaphore_2.10.35_linux_amd64.tar.gz' | ||
#semaphore_download_binary: false | ||
semaphore_web_root: 'https://controller' | ||
semaphore_db_host: '127.0.0.1' | ||
controller_repository_name: "example-repo" | ||
controller_repository_git_url: "https://github.comi/bbaassssiiee/controller.git" | ||
controller_repository_git_branch: "main" | ||
nginx_add_repo: false | ||
|
||
ssh_passphrase: "SomethingYouNeedToUse" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# shared with semaphore role | ||
semaphore_env: /home/semaphore/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
desired_state: present | ||
semaphore_download_binary: true | ||
semaphore_download_package: true | ||
verify_state: true | ||
# Easier debugging | ||
debug: false | ||
|
@@ -9,10 +9,14 @@ semaphore_port: 3000 | |
semaphore_db_host: "{{ ansible_default_ipv4.address }}" | ||
bind_port: 3000 | ||
semaphore_service_uri: "https://{{ ansible_fqdn | default(ansible_hostname) }}" | ||
# These default values are generated once, override with group_vars. | ||
# Use ansible-vault to encrypt values generated with | ||
# `head -c32 /dev/urandom | base64` | ||
vault_access_key_encryption: "{{ lookup('pipe', 'head -c32 /dev/urandom | base64') }}" | ||
vault_admin_password: "{{ lookup('pipe', 'head -c32 /dev/urandom | base64') }}" | ||
vault_cookie_encryption: "{{ lookup('pipe', 'head -c32 /dev/urandom | base64') }}" | ||
vault_cookie_hash: "{{ lookup('pipe', 'head -c32 /dev/urandom | base64') }}" | ||
# Whether to create an admin user | ||
semaphore_admin_user_manage: true | ||
# Use ansible-vault to encrypt values vars/main.yml refers to the vault_* variables | ||
vault_admin_user: admin | ||
vault_admin_email: [email protected] | ||
# These default values should be generated for your own environment. | ||
# Generated with `head -c32 /dev/urandom | base64` | ||
vault_access_key_encryption: 'POHO2/pWKVRIVmV8gJGlcF9I/RNBHplD5Ki4aMWnz6M=' | ||
vault_admin_password: '/nOKL/PaudDI1J80KB0pQYPGlvAoaMg8ea71MdvS2tI=' | ||
vault_cookie_encryption: 'q0luUwCsnzAUBjUYNHCNU5VpZEvjy0fPS698t9SvBYQ=' | ||
vault_cookie_hash: 'w9vz6qSsDIQVLM7kC42QdXC/YoIgH9MFWIONIMSFfxc=' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,48 @@ | ||
--- | ||
- name: Gather service facts | ||
ansible.builtin.service_facts: | ||
no_log: "{{ not debug }}" | ||
|
||
- name: Stop semaphore service | ||
when: | ||
- ansible_facts.services['semaphore.service'] is defined | ||
- ansible_facts.services['semaphore.service'].state == 'running' | ||
ansible.builtin.systemd: | ||
name: semaphore.service | ||
state: stopped | ||
|
||
- name: Stop and disable semaphore service | ||
when: | ||
- ansible_facts.services['semaphore.service'] is defined | ||
- ansible_facts.services['semaphore.service'].status == 'enabled' | ||
ansible.builtin.systemd: | ||
name: semaphore.service | ||
enabled: false | ||
state: stopped | ||
daemon_reload: true | ||
|
||
- name: Remove systemd service file | ||
ansible.builtin.file: | ||
path: /usr/lib/systemd/system/semaphore.service | ||
state: absent | ||
|
||
- name: Kill processes of semaphore user | ||
ansible.builtin.command: | ||
cmd: killall -u semaphore | ||
register: killed | ||
failed_when: killed.rc not in [0, 1] | ||
changed_when: killed.rc == 0 | ||
|
||
- name: Check compose file | ||
ansible.builtin.stat: | ||
path: /home/semaphore/docker-compose.yml | ||
register: compose_file | ||
|
||
- name: Remove docker-compose | ||
when: compose_file.stat.exists | bool | ||
community.docker.docker_compose_v2: | ||
project_src: /home/semaphore | ||
state: absent | ||
remove_images: all | ||
remove_volumes: true | ||
remove_orphans: true | ||
|
||
- name: Remove config directory | ||
ansible.builtin.file: | ||
path: "/home/semaphore/{{ item }}" | ||
state: absent | ||
loop: | ||
- config | ||
- .env | ||
- docker-compose.yml | ||
|
||
- name: Remove docker modules | ||
ansible.builtin.pip: | ||
name: | ||
- docker | ||
- docker-compose | ||
path: /etc/semaphore | ||
state: absent | ||
|
||
- name: Remove semaphore user | ||
ansible.builtin.user: | ||
name: semaphore | ||
state: absent | ||
|
||
- name: Remove semaphore package | ||
ansible.builtin.package: | ||
name: semaphore | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.