Skip to content
Open
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
9 changes: 8 additions & 1 deletion os_builders/build.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ source "openstack" "builder" {
domain_name = "Default"
flavor = "l3.imagecreate"
security_groups = ["default"]
networks = ["${local.env_network_id}"]
networks = ["${local.env_network_id}"]
image_visibility = "private"
ssh_timeout = "20m"
image_min_disk = "20"
Expand Down Expand Up @@ -141,5 +141,12 @@ build {
"--scp-extra-args", "'-O'",
]
}
provisioner "ansible" {
user = "${build.User}"
playbook_file = "testing_os_images.yml"
extra_arguments = [
"--scp-extra-args", "'-O'",
]
}
}

2 changes: 2 additions & 0 deletions os_builders/roles/run_test/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- include_tasks: stateful.yml
- include_tasks: regression.yml
12 changes: 12 additions & 0 deletions os_builders/roles/run_test/tasks/regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: Check only root, rocky, ubuntu and cloud users exist
ansible.builtin.command: awk -F':' '($3 == 0 || $3 >= 1000) && $3 < 65534 && $1 !~ /^(root|rocky|ubuntu|cloud)$/ {print $1}' /etc/passwd
register: run_test_unexpected_users
changed_when: false
failed_when: run_test_unexpected_users.stdout != ""


- name: Check hostname is host-172-16-X-X.nubes.rl.ac.uk
ansible.builtin.command: hostname
register: run_test_hostname
changed_when: false
failed_when: run_test_hostname.stdout is not match('^host-172-16-[0-9]+-[0-9]+\.nubes\.rl\.ac\.uk$')
Empty file.
5 changes: 5 additions & 0 deletions os_builders/testing_os_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Run Tests On all STFC Cloud Images
hosts: all
roles:
- role: run_test
Loading