diff --git a/ansible/gold-master.yml b/ansible/gold-master.yml index 0889fde9aaa4eeb82af5370d2a0e45cd98ffc7e1..d5e898dc9331f4bf9fd62de7d5da99d7ed119482 100644 --- a/ansible/gold-master.yml +++ b/ansible/gold-master.yml @@ -8,7 +8,7 @@ # NOTE: on first run this fetches the whole image (~650MB) over the Internet - name: lxd_bootstrap container_name: gold-master - alias: ubuntu/xenial/amd64 + alias: "16.04" tasks: - name: create br-wan profile diff --git a/ansible/roles/lxd_bootstrap/defaults/main.yml b/ansible/roles/lxd_bootstrap/defaults/main.yml index 1cc8694f28a88c45e63effcae8c751f1a75e9901..38b2a10909687638186a7ab8bd776cd8c044d0e9 100644 --- a/ansible/roles/lxd_bootstrap/defaults/main.yml +++ b/ansible/roles/lxd_bootstrap/defaults/main.yml @@ -1,3 +1,3 @@ profiles: [default] -alias: ubuntu/xenial/amd64 +alias: "16.04" wait_for_ipv4_addresses: false diff --git a/ansible/roles/lxd_bootstrap/tasks/main.yml b/ansible/roles/lxd_bootstrap/tasks/main.yml index 22735be14ec4d106d513ec7b2a2bd07037b53160..4132ac6118bc565bcf0792f719482d4ea9b80d82 100644 --- a/ansible/roles/lxd_bootstrap/tasks/main.yml +++ b/ansible/roles/lxd_bootstrap/tasks/main.yml @@ -3,15 +3,15 @@ # for management via ansible. For more ideas see # https://github.com/novafloss/ansible-role-boot/blob/master/tasks/lxd.yml -- name: create and start {{ container_name }} container +- name: create and start {{ container_name }} container with {{ alias }} lxd_container: name: '{{ container_name }}' state: started source: type: image mode: pull - server: https://images.linuxcontainers.org - protocol: lxd + server: https://cloud-images.ubuntu.com/releases + protocol: simplestreams alias: '{{ alias }}' profiles: '{{ profiles }}' wait_for_ipv4_addresses: '{{ wait_for_ipv4_addresses }}' @@ -22,25 +22,27 @@ # https://github.com/lxc/lxd/issues/2166 # Workaround: # http://bnpcs.blogspot.co.uk/2010/11/disable-http-pipelining-in-ubuntu.html +# However this is not required for the "official" Ubuntu images which +# contain /etc/apt/apt.conf.d/90cloud-init-pipelining -- name: check pipelining for apt-get - delegate_to: '{{ container_name }}' - raw: test -f /etc/apt/apt.conf.d/00no-pipeline - register: apt_pipeline_check - failed_when: apt_pipeline_check.rc not in [0, 1] - changed_when: false +#- name: check pipelining for apt-get +# delegate_to: '{{ container_name }}' +# raw: test -f /etc/apt/apt.conf.d/00no-pipeline +# register: apt_pipeline_check +# failed_when: apt_pipeline_check.rc not in [0, 1] +# changed_when: false -- name: disable pipelining for apt-get - delegate_to: '{{ container_name }}' - raw: echo 'Acquire::http::Pipeline-Depth "0";' >/etc/apt/apt.conf.d/00no-pipeline - when: apt_pipeline_check.rc == 1 - changed_when: apt_pipeline_check.rc == 1 +#- name: disable pipelining for apt-get +# delegate_to: '{{ container_name }}' +# raw: echo 'Acquire::http::Pipeline-Depth "0";' >/etc/apt/apt.conf.d/00no-pipeline +# when: apt_pipeline_check.rc == 1 +# changed_when: apt_pipeline_check.rc == 1 # Ansible cannot run in a container unless python2 is present. # So we must force it to be installed using raw commands. - name: check python is installed in container delegate_to: '{{ container_name }}' - raw: dpkg-query -W -f='${Status}' python + raw: dpkg -s python register: python_install_check failed_when: python_install_check.rc not in [0, 1] changed_when: false