2c89234de242f6b5a1dc76fe556255d2b22196c0
[csit.git] / resources / tools / testbed-setup / ansible / roles / cobbler / tasks / ubuntu-18.04.2-server-x86_64.yaml
1 ---
2 # file: roles/cobbler/tasks/ubuntu-18.04.2-server-x86_64.yaml
3
4 - name: Download Ubuntu 18.04.2 Server x86_64 with check (sha256)
5   get_url:
6     url: 'http://cdimage.ubuntu.com/ubuntu/releases/18.04/release/ubuntu-18.04.2-server-amd64.iso'
7     dest: '/mnt/ubuntu-18.04.2-server-amd64.iso'
8     checksum: 'sha256:a2cb36dc010d98ad9253ea5ad5a07fd6b409e3412c48f1860536970b073c98f5'
9   register: __iso_downloaded
10   tags: cobbler-import-image
11
12 - name: Create directory for Ubuntu 18.04.2 Server x86_64 mount
13   file:
14     path: '/mnt/ubuntu-18.04.2-server-x86_64'
15     state: 'directory'
16   register: __mount_directory_created
17   tags: cobbler-import-image
18
19 - name: Mount Ubuntu 18.04.2 Server x86_64 iso
20   mount:
21     src: '/mnt/ubuntu-18.04.2-server-amd64.iso'
22     path: '/mnt/ubuntu-18.04.2-server-x86_64'
23     fstype: 'iso9660'
24     opts: 'ro,loop'
25     state: mounted
26   when: __iso_downloaded and __mount_directory_created
27   tags: cobbler-import-image
28
29 - name: Run cobbler distro import for Ubuntu 18.04.2 Server x86_64
30   command: |
31       docker exec -i cobbler cobbler import
32       --path=/mnt/ubuntu-18.04.2-server-x86_64
33       --name=ubuntu-18.04.2-server-x86_64
34       --kickstart=/var/lib/cobbler/kickstarts/ubuntu-18.04.2-server-x86_64.seed
35   tags: cobbler-import-image