kolla-ansible/ansible/roles/bifrost/tasks/bootstrap.yml
Mark Goddard e13815c7b0 Stabilise Bifrost CI job
The Bifrost CI job seems quite unstable, often failing while attempting
to reach the public epel package repositories. We shouldn't need to
install any packages when deploying the container - they should all have
been installed in the image already.

This change avoids running the scripts/env-setup.sh script, which is run
when the container image is built.

It also removes sourcing of /opt/stack/ansible/hacking/env-setup, which
is now just a stub.

Change-Id: I1786e5337a397cb7b427d6b87c21eaee600af170
2018-08-02 14:56:55 +01:00

44 lines
1.9 KiB
YAML

---
- name: Ensure log directories exist
vars:
nginx_user: "{{ 'www-data' if is_debian else 'nginx' }}"
is_debian: "{{ kolla_base_distro in ['debian', 'ubuntu'] }}"
command: >
docker exec bifrost_deploy
bash -c 'mkdir -p /var/log/kolla/ironic &&
chown ironic:ironic /var/log/kolla/ironic &&
mkdir -p /var/log/kolla/ironic-inspector &&
chown ironic:ironic /var/log/kolla/ironic-inspector &&
mkdir -p /var/log/kolla/nginx &&
chown {{ nginx_user }}:{{ nginx_user }} /var/log/kolla/nginx'
- name: Bootstrap bifrost (this may take several minutes)
command: >
docker exec bifrost_deploy
bash -c 'source /bifrost/env-vars
&& cp /etc/bifrost/rabbitmq-env.conf /etc/rabbitmq/rabbitmq-env.conf &&
chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq-env.conf &&
ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target
/bifrost/playbooks/install.yaml -e @/etc/bifrost/bifrost.yml
-e @/etc/bifrost/dib.yml -e skip_package_install=true'
- name: Installing ssh keys
command: >
docker exec bifrost_deploy
bash -c 'mkdir /root/.ssh ; mkdir /home/ironic/.ssh;
cp -f /etc/bifrost/id_rsa /root/.ssh/id_rsa &&
cp -f /etc/bifrost/id_rsa.pub /root/.ssh/id_rsa.pub &&
cp -f /etc/bifrost/ssh_config /root/.ssh/config &&
cp -f /etc/bifrost/id_rsa /home/ironic/.ssh/id_rsa &&
cp -f /etc/bifrost/id_rsa.pub /home/ironic/.ssh/id_rsa.pub &&
cp -f /etc/bifrost/ssh_config /home/ironic/.ssh/config &&
chmod 600 /root/.ssh/id_rsa &&
chmod 600 /root/.ssh/id_rsa.pub &&
chmod 600 /root/.ssh/config &&
chmod 600 /home/ironic/.ssh/id_rsa &&
chmod 600 /home/ironic/.ssh/id_rsa.pub &&
chmod 600 /home/ironic/.ssh/config &&
chown ironic:ironic /home/ironic/.ssh/id_rsa &&
chown ironic:ironic /home/ironic/.ssh/id_rsa.pub &&
chown ironic:ironic /home/ironic/.ssh/config'