puppet-openstack-integration/playbooks/run-libraries-beaker-tests.yaml
Tobias Urdin 748c877a12 Make beaker tests honour puppet_gem_version
This commit was correct [1] when it added the
puppet_gem_version ansible var to the jobs to
restrict the gems version in puppet-openstack_spec_helper.

However since we haven't modified it to read the
variable and set the PUPPET_GEM_VERSION environment
variable it wasn't honoured by the spec helper when
it installed the puppet gem like done in [2].

[1] https://review.openstack.org/#/c/632962/
[2] d61f652b0a/playbooks/run-unit-tests.yaml (L6)

Change-Id: I61cb86b42d2ce12e9eabed3aac7b4b185ca987b5
2019-01-25 14:58:16 +01:00

37 lines
1.5 KiB
YAML

- hosts: all
tasks:
- shell:
cmd: |
echo "" | sudo tee -a /etc/ssh/sshd_config
echo "Match address 127.0.0.1" | sudo tee -a /etc/ssh/sshd_config
echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
echo "" | sudo tee -a /etc/ssh/sshd_config
echo "Match address ::1" | sudo tee -a /etc/ssh/sshd_config
echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
mkdir -p .ssh
ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P ""
sudo mkdir -p /root/.ssh
cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
if [[ -f /usr/bin/yum || -f /usr/bin/dnf ]]; then
sudo systemctl reload sshd
elif [ -f /usr/bin/apt-get ]; then
sudo service ssh restart
fi
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
trap "{{ ansible_user_dir }}/workspace/openstack/puppet-openstack-integration/copy_logs.sh" EXIT
if [ "{{ puppet_gem_version }}" != "latest" ]; then
export PUPPET_GEM_VERSION='~> {{ puppet_gem_version }}'
fi
export BEAKER_PUPPET_COLLECTION=puppet5
export BEAKER_set=nodepool-{{ nodepool_type }}
./run_beaker_tests.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'