aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml45
1 files changed, 45 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml
new file mode 100644
index 0000000000..f48a976ea1
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml
@@ -0,0 +1,45 @@
+---
+# file: roles/cobbler/tasks/main.yaml
+
+- name: Sync the cobbler docker directory
+ synchronize:
+ src: 'files'
+ dest: '/home/{{ ansible_user }}/cobbler_docker'
+ register: __cobbler_image_built
+ tags: cobbler-build-image
+
+- name: Build the cobbler docker image
+ docker_image:
+ path: '/home/{{ ansible_user }}/cobbler_docker/files'
+ name: 'csit/cobbler'
+ buildargs:
+ cobbler_pass: '{{ cobbler_pass }}'
+ cobbler_web_pass: '{{ cobbler_password }}'
+ cobbler_ip_addr: '{{ inventory_hostname }}'
+ when: __cobbler_image_built
+ tags: cobbler-build-image
+
+- name: Run Cobbler image
+ docker_container:
+ name: 'cobbler'
+ image: 'csit/cobbler'
+ network_mode: 'host'
+ volumes:
+ - '/mnt:/mnt:ro'
+ register: __cobbler_image_running
+ tags: cobbler-run-image
+
+- name: Run cobbler setup get-loaders
+ command: 'docker exec -i cobbler cobbler get-loaders'
+ when: __cobbler_image_running
+ tags: cobbler-run-image
+
+- name: Run cobbler setup sync
+ command: 'docker exec -i cobbler cobbler sync'
+ when: __cobbler_image_running
+ tags: cobbler-run-image
+
+- name: Add Ubuntu 18.04.2 Server x86_64 to cobbler
+ include_tasks: 'ubuntu-18.04.2-server-x86_64.yaml'
+ when: __cobbler_image_running
+ tags: cobbler-run-image