Skip to content

Commit

Permalink
Add script to clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Büchse <[email protected]>
  • Loading branch information
mbuechse committed Jan 24, 2024
1 parent 3845c7a commit 6b12f8a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 51 deletions.
2 changes: 2 additions & 0 deletions .zuul.d/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- job:
name: scs-check-adr-syntax
parent: base
pre-run: playbooks/pre.yml
run: playbooks/adr_syntax.yaml
- job:
name: scs-check-gx-scs
Expand All @@ -31,6 +32,7 @@
secret: SECRET_STANDARDS
vars:
cloud: gx-scs
pre-run: playbooks/pre.yml
run: playbooks/compliance_check.yaml
- job:
name: scs-check-gx-scs-main
Expand Down
10 changes: 5 additions & 5 deletions Tests/iaas/entropy/entropy-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@

logger = logging.getLogger(__name__)

NETWORK_NAME = "scs-0101-net"
ROUTER_NAME = "scs-0101-router"
SERVER_NAME = "scs-0101-server"
SECURITY_GROUP_NAME = "scs-0101-group"
KEYPAIR_NAME = "scs-0101-keypair"
NETWORK_NAME = "_scs-0101-net"
ROUTER_NAME = "_scs-0101-router"
SERVER_NAME = "_scs-0101-server"
SECURITY_GROUP_NAME = "_scs-0101-group"
KEYPAIR_NAME = "_scs-0101-keypair"

IMAGE_ATTRIBUTES = {
# https://docs.openstack.org/glance/2023.1/admin/useful-image-properties.html#image-property-keys-and-values
Expand Down
20 changes: 0 additions & 20 deletions playbooks/adr_syntax.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
---
- name: Run ADR syntax check tool and test script consistency check tool
hosts: all
roles:
- role: ensure-pip # https://zuul-ci.org/docs/zuul-jobs/latest/python-roles.html#role-ensure-pip
tasks:
- name: Copy ADRs on the node
ansible.builtin.copy:
src: "../Standards"
dest: "~/"
mode: 0500
no_log: false

- name: Copy Tests on the node
ansible.builtin.copy:
src: "../Tests"
dest: "~/"
mode: 0500
no_log: false

- name: Install dependencies
ansible.builtin.pip:
requirements: /home/ubuntu/Tests/requirements.txt

- name: Run ADR syntax check script
ansible.builtin.command:
cmd: python3 /home/ubuntu/Tests/chk_adrs.py /home/ubuntu/Standards
Expand Down
31 changes: 5 additions & 26 deletions playbooks/compliance_check.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
---
- name: Run compliance check tool
hosts: all
roles:
- role: ensure-pip # https://zuul-ci.org/docs/zuul-jobs/latest/python-roles.html#role-ensure-pip
tasks:
- name: Create cloud config dir
ansible.builtin.file:
path: "~/.config/openstack"
state: directory
recurse: true
mode: "0700"

- name: Create cloud config file
ansible.builtin.template:
src: "clouds.yaml.j2"
dest: "~/.config/openstack/clouds.yaml"
mode: "0600"
no_log: true

- name: Copy Tests on the node
ansible.builtin.copy:
src: "../Tests"
dest: "~/"
mode: 0500
no_log: false

- name: Install dependencies
ansible.builtin.pip:
requirements: /home/ubuntu/Tests/requirements.txt
- name: Clean up any lingering resources from previous run
ansible.builtin.command:
cmd: python3 /home/ubuntu/Tests/cleanup.py -c {{ cloud }} -p _scs-
failed_when: false
changed_when: true

- name: Run compliance script
ansible.builtin.command:
Expand Down
37 changes: 37 additions & 0 deletions playbooks/pre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- name: Run compliance check tool
hosts: all
roles:
- role: ensure-pip # https://zuul-ci.org/docs/zuul-jobs/latest/python-roles.html#role-ensure-pip
tasks:
- name: Create cloud config dir
ansible.builtin.file:
path: "~/.config/openstack"
state: directory
recurse: true
mode: "0700"

- name: Create cloud config file
ansible.builtin.template:
src: "clouds.yaml.j2"
dest: "~/.config/openstack/clouds.yaml"
mode: "0600"
no_log: true

- name: Copy ADRs on the node
ansible.builtin.copy:
src: "../Standards"
dest: "~/"
mode: 0500
no_log: false

- name: Copy Tests on the node
ansible.builtin.copy:
src: "../Tests"
dest: "~/"
mode: 0500
no_log: false

- name: Install dependencies
ansible.builtin.pip:
requirements: /home/ubuntu/Tests/requirements.txt

0 comments on commit 6b12f8a

Please sign in to comment.