Help wanted: converting our GitLab CI scripts to modern Ansible

Martin Schwenke martin at meltin.net
Thu Dec 17 11:23:20 UTC 2020


On Thu, 17 Dec 2020 23:26:30 +1300, Andrew Bartlett via samba-technical
<samba-technical at lists.samba.org> wrote:

> The Samba GitLab CI bastian system (where gitlab-runner runs, spawning
> new VMs per job) is built with Ansible.
> 
> However the Openstack module we are using, which is compatible with the
> Catalyst Cloud and Rackspace (where it runs in productions), is not
> compatible with the Oregen State University Open Source Lab (OSU OSL)
> cloud that we want to move to.  This is despite this also running
> Openstack.
> 
> The current sticking point appears to be that we create a volume (to
> back to root hard disk of the server) which is not marked bootable.
> 
> MSG:
> 
> BadRequestException: 400: Client Error for url: 
> http://oprod-controller1.osuosl.org:8774/v2.1/4917f5faae154a619dddd437eeb053b8/os-volumes_boot
> , Block Device b22d6488-9a5f-4c54-864d-e567ae5fda9d is not bootable.
> 
> We use
> https://docs.ansible.com/ansible/2.4/os_volume_module.html
> but we need to be using
> https://docs.ansible.com/ansible/latest/collections/openstack/cloud/volume_module.html
> 
> If someone has the time and expertise to port our scripts over this
> would be most helpful.
> 
> The scripts are at:
> 
> https://gitlab.com/catalyst-samba/samba-cloud-autobuild/-/tree/master/gitlab-ci
> and the roles we pull in here:
> https://gitlab.com/catalyst-samba/samba-cloud-autobuild/-/blob/master/ansible-roles-clone-or-update.yml

As far as I can tell the following 2 modules are identical:

  https://docs.ansible.com/ansible/latest/collections/openstack/cloud/os_volume_module.html#ansible-collections-openstack-cloud-os-volume-module

  https://docs.ansible.com/ansible/latest/collections/openstack/cloud/volume_module.html#ansible-collections-openstack-cloud-volume-module

However, the bootable parameter appears to be relatively new and
defaults to "no".  So, this should fix it:

diff --git a/tasks/servers_create.yml b/tasks/servers_create.yml
index e4d0582..c2857a0 100644
--- a/tasks/servers_create.yml
+++ b/tasks/servers_create.yml
@@ -5,6 +5,7 @@
     size: "{{ item.volume_size|int }}"
     volume_type: "{{ item.volume_type }}"
     image: "{{ item.image }}"
+    bootable: yes
   when: 'item.volume_size|int > 0'
   loop: "{{ _OS_SERVERS|default([]) }}"
 
Have you tried that?

peace & happiness,
martin



More information about the samba-technical mailing list