tripleo-quickstart-extras/playbooks/prepare-slave.yml
Dmitry Tantsur 6012516cab Update OVB jobs to use the 'ipmi' driver before Queens
Since the testenv scripts do not have access to the release, update
the resulting instackenv.json with sed.

Change-Id: Iae5088e0d8a8a594c9b3a2d625a0daf829ba7b4b
2018-04-27 21:14:11 +00:00

49 lines
1.8 KiB
YAML

# Playbook included in OVB setups that use a testenv broker to create the
# OVB stack.
- name: Local setup for quickstart
hosts: localhost
connection: local
tasks:
- name: Host setup
shell: >
echo "127.0.0.1 $(hostname) $(hostname).openstacklocal" | sudo tee -a /etc/hosts;
echo "127.0.0.2 undercloud undercloud.openstacklocal" | sudo tee -a /etc/hosts;
if [ ! -e ${HOME}/.ssh/id_rsa.pub ] ; then
if [[ -e ${HOME}/.ssh/id_rsa ]]; then
ssh-keygen -y -f ${HOME}/.ssh/id_rsa > ${HOME}/.ssh/id_rsa.pub;
else
ssh-keygen -N "" -f ${HOME}/.ssh/id_rsa;
fi
fi;
sudo mkdir -p /root/.ssh;
cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys | tee -a ~/.ssh/authorized_keys;
sudo yum remove -y puppet hiera puppetlabs-release rdo-release centos-release-[a-z]*;
sudo rm -rf /etc/puppet /etc/hiera.yaml;
sudo cp {{tripleo_root}}/tripleo-ci/test-environments/overcloud-cacert.pem /etc/pki/ca-trust/source/anchors/;
sudo update-ca-trust extract;
cp -f {{ lookup('env', 'TE_DATAFILE') }} ~/instackenv.json;
- name: Correct the driver for newer releases
# TODO(dtantsur): remove when Pike is not supported
command: sed -i s/pxe_ipmitool/ipmi/ ~/instackenv.json
when: release not in ['newton', 'ocata', 'pike']
- name: Create eth2.conf file
blockinfile:
dest: "{{ working_dir }}/eth2.conf"
content: |
network_config:
- type: interface
name: eth2
use_dhcp: false
addresses:
- ip_netmask: 10.0.0.1/24
- ip_netmask: 2001:db8:fd00:1000::1/64
create: yes
- name: Install ipmitool if not installed
yum: name=ipmitool state=latest
become: true