-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a new Debian 12 server to replace the Debian 8 `gh-bot` server. Update the `ansible/playbooks/create-github-bot.yml` playbook to automate setup, including: - Fetching of deployment secrets from the secrets repository. - Generating the allowlist of `jenkins-workspace` IP addresses from the inventory. - Restarting the services if required.
- Loading branch information
1 parent
12487a2
commit 5c8680c
Showing
8 changed files
with
103 additions
and
39 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
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,15 @@ | ||
--- | ||
|
||
# | ||
# generic handlers for github-bot | ||
# | ||
|
||
- name: restart github-bot | ||
ansible.builtin.service: | ||
name: github-bot | ||
state: restarted | ||
|
||
- name: restart github-bot-deploy-webhook | ||
ansible.builtin.service: | ||
name: github-bot-deploy-webhook | ||
state: restarted |
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,14 +1,14 @@ | ||
NODE_ENV=production | ||
PORT={{ envs.port }} | ||
TRAVIS_TOKEN={{ envs.travis_token }} | ||
GITHUB_TOKEN={{ envs.github_token }} | ||
GITHUB_WEBHOOK_SECRET={{ envs.github_webhook_secret }} | ||
LOGIN_CREDENTIALS={{ envs.login_credentials }} | ||
PORT={{ gh_bot_secrets.envs.port }} | ||
TRAVIS_TOKEN={{ gh_bot_secrets.envs.travis_token }} | ||
GITHUB_TOKEN={{ gh_bot_secrets.envs.github_token }} | ||
GITHUB_WEBHOOK_SECRET={{ gh_bot_secrets.envs.github_webhook_secret }} | ||
LOGIN_CREDENTIALS={{ gh_bot_secrets.envs.login_credentials }} | ||
NODE_REPO_DIR=/home/{{ server_user }}/repos/node | ||
LOGS_DIR=/home/{{ server_user }}/logs | ||
JENKINS_API_CREDENTIALS={{ envs.jenkins_api_credentials }} | ||
JENKINS_JOB_CITGM={{ envs.jenkins_job_citgm }} | ||
JENKINS_BUILD_TOKEN_CITGM={{ envs.jenkins_build_token_citgm }} | ||
JENKINS_JOB_NODE={{ envs.jenkins_job_node }} | ||
JENKINS_BUILD_TOKEN_NODE={{ envs.jenkins_build_token_node }} | ||
JENKINS_WORKER_IPS=147.75.70.237,51.15.200.62,51.15.218.201,163.172.186.154,147.75.66.203,147.75.81.67,52.117.26.14,147.75.72.255,145.40.96.123 | ||
JENKINS_API_CREDENTIALS={{ gh_bot_secrets.envs.jenkins_api_credentials }} | ||
JENKINS_JOB_CITGM={{ gh_bot_secrets.envs.jenkins_job_citgm }} | ||
JENKINS_BUILD_TOKEN_CITGM={{ gh_bot_secrets.envs.jenkins_build_token_citgm }} | ||
JENKINS_JOB_NODE={{ gh_bot_secrets.envs.jenkins_job_node }} | ||
JENKINS_BUILD_TOKEN_NODE={{ gh_bot_secrets.envs.jenkins_build_token_node }} | ||
JENKINS_WORKER_IPS={{ jenkins_workspace_ips | join(',') }} |
2 changes: 1 addition & 1 deletion
2
ansible/roles/github-bot/templates/github-bot-deploy-webhook.json.j2
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,7 +1,8 @@ | ||
--- | ||
base_packages: | ||
- aptitude | ||
- python-apt | ||
- python3-apt | ||
- systemd-timesyncd | ||
|
||
packages: | ||
- nodejs | ||
|
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,13 @@ | ||
--- | ||
|
||
- name: Read github-bot secrets | ||
ansible.builtin.set_fact: | ||
gh_bot_secrets: "{{ lookup('pipe', 'gpg -d ' + group_vars | quote) | from_yaml }}" | ||
no_log: yes | ||
loop_control: | ||
loop_var: group_vars | ||
with_first_found: | ||
- files: | ||
- "{{ secrets_repo_root }}/build/github-bot/deployment_secrets.yml" | ||
skip: true | ||
when: alias is defined and alias == 'gh-bot' |