forked from BonnyCI/hoist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an ansible-runner task to run bonnyci-test-suite
Until we can run this as a periodic job in Zuul and get its logs published into logstash, run it as an ansible task from the bastion. This essentially just sets up the task, a user and passes through some secrets. The test suite itself contains a playbook, which the ansible-runner task calls, to convert the secrets into a test config and run the test suite. The datadog monitor should be able to monitor for the runner task and report on its failure. Closes-Issue: BonnyCI/projman#178 Signed-off-by: Adam Gandelman <adamg@ubuntu.com>
- Loading branch information
1 parent
8166339
commit ee8a0a8
Showing
9 changed files
with
82 additions
and
5 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
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,2 @@ | ||
test_suite_user: bonnyci-test-suite | ||
test_suite_homedir: /var/lib/bonnyci-test-suite |
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,2 @@ | ||
|1|sZsXNcKhZcbBZs+DPD6mFkw1l7k=|G8U7iIJ+htP9bxkRoe3Zss2WiR8= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== | ||
|1|dRlxGwUzT9kmk0gcajFrqrKZ67o=|F0r14BhXr24oGRZUvZD0r7SCJ7o= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== |
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,43 @@ | ||
- name: Create the test suite user | ||
user: | ||
name: "{{ test_suite_user }}" | ||
home: "{{ test_suite_homedir }}" | ||
system: yes | ||
state: present | ||
|
||
- name: Create test suite user ssh directory | ||
file: | ||
path: "{{ test_suite_homedir }}/.ssh" | ||
state: directory | ||
owner: "{{ test_suite_user }}" | ||
group: "{{ test_suite_user }}" | ||
|
||
- name: Write out test suite user ssh private key | ||
copy: | ||
dest: "{{ test_suite_homedir }}/.ssh/id_rsa" | ||
content: "{{ secrets.ssh_keys.test_suite.private }}" | ||
owner: "{{ test_suite_user }}" | ||
group: "{{ test_suite_user }}" | ||
mode: 0600 | ||
|
||
- name: Write out test suite user known_hosts | ||
copy: | ||
dest: "{{ test_suite_homedir }}/.ssh/known_hosts" | ||
src: "github_known_hosts" | ||
owner: "{{ test_suite_user }}" | ||
group: "{{ test_suite_user }}" | ||
|
||
- name: Write out test suite secrets | ||
template: | ||
dest: "{{ test_suite_homedir }}/test_secrets.yml" | ||
src: test_secrets.yml | ||
owner: "{{ test_suite_user }}" | ||
group: "{{ test_suite_user }}" | ||
mode: 0600 | ||
|
||
- name: give sudo access to user to update venv | ||
copy: | ||
dest: /etc/sudoers.d/99_bonnyci-test-suite | ||
mode: 0400 | ||
owner: root | ||
content: "bonnyci-test-suite ALL=(ALL) NOPASSWD:ALL" |
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 @@ | ||
{{ secrets.bonnyci_test_suite | to_nice_yaml(indent=2) }} |
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