From 99cd65e8d4fa34024bdc0b5d9ac4fcf2c573e327 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 3 Mar 2017 15:01:50 +0000 Subject: [PATCH] Add playbooks to build seed and overcloud Docker images --- ansible/overcloud-image-build.yml | 65 +++++++++++++++++++++++++++++++ ansible/seed-image-build.yml | 26 +++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 ansible/overcloud-image-build.yml create mode 100644 ansible/seed-image-build.yml diff --git a/ansible/overcloud-image-build.yml b/ansible/overcloud-image-build.yml new file mode 100644 index 000000000..48cf50a4a --- /dev/null +++ b/ansible/overcloud-image-build.yml @@ -0,0 +1,65 @@ +--- +- name: Ensure Kolla container images are built for overcloud services + #hosts: controllers + hosts: seed + vars: + # Set this to True to push images to the registry when built. + push_images: False + image_regex_map: + - regex: cinder + enabled: True + - regex: cron + enabled: True + - regex: dnsmasq + enabled: True + - regex: fluentd + enabled: True + - regex: glance + enabled: "{{ kolla_enable_glance | bool }}" + - regex: haproxy + enabled: True + - regex: heat + enabled: True + - regex: horizon + enabled: True + - regex: ironic + enabled: "{{ kolla_enable_ironic | bool }}" + - regex: iscsid + enabled: True + - regex: keepalived + enabled: True + - regex: keystone + enabled: True + - regex: kolla-toolbox + enabled: True + - regex: mariadb + enabled: True + - regex: memcached + enabled: True + - regex: neutron-server + enabled: True + # Neutron SFC agent not currently supported on CentOS binary builds. + - regex: "neutron-\\(dhcp\\|l3\\|metadata\\|openvswitch\\)-agent" + enabled: True + - regex: nova + enabled: True + - regex: openvswitch + enabled: True + - regex: rabbitmq + enabled: True + - regex: swift + enabled: "{{ kolla_enable_swift | bool }}" + - regex: tgtd + enabled: True + image_regexes: "{{ image_regex_map | selectattr('enabled') | map(attribute='regex') | list }}" + tasks: + - name: Ensure custom Kolla images are built + shell: > + source kolla-venv/bin/activate && + kolla-build \ + --config-dir {{ kolla_config_path }} \ + {% if push_images | bool %}--push{% endif %} \ + {{ item.regex }} + with_items: + - regex: "{{ image_regexes | join(' ') }}" + run_once: True diff --git a/ansible/seed-image-build.yml b/ansible/seed-image-build.yml new file mode 100644 index 000000000..1cad73f3c --- /dev/null +++ b/ansible/seed-image-build.yml @@ -0,0 +1,26 @@ +--- +- name: Ensure Kolla container images are built for seed services + hosts: seed + vars: + # Set this to True to push images to the registry when built. + push_images: False + image_regex_map: + - regex: bifrost + enabled: True + image_regexes: "{{ image_regex_map | selectattr('enabled') | map(attribute='regex') | list }}" + tasks: + - name: Ensure custom Kolla images are built + shell: > + source kolla-venv/bin/activate && + kolla-build \ + --config-dir {{ kolla_config_path }} \ + --type {{ item.type }} \ + --namespace {{ item.namespace }} \ + --tag {{ item.tag }} \ + {% if push_images | bool %}--push{% endif %} \ + {{ item.regex }} + with_items: + - type: source + namespace: "{{ kolla_docker_namespace }}" + tag: "{{ kolla_openstack_release }}" + regex: "{{ image_regexes | join(' ') }}"