system-config/playbooks/zuul/infra-puppet-beaker-rspec/run.yaml
Monty Taylor ca684c775b Move puppet apply jobs to system-config repo
These use legacy-base, which sucks, but what sucks even more is
that they are in openstack-zuul-jobs, which makes them extra
awkward to try to adjust.

Change-Id: I87b3d56de41f0ba5658c1240ddfc7ecf1c3c43af
2020-04-19 10:57:22 -05:00

55 lines
1.9 KiB
YAML

- hosts: all
name: Beaker-rspec functional testing for Infra puppet modules
roles:
- bindep
tasks:
- name: Set up SSH for beaker
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 ]; then
sudo systemctl reload sshd
elif [ -f /usr/bin/apt-get ]; then
sudo service ssh restart
fi
- name: Create local gems directory
file:
state: directory
path: '{{ ansible_user_dir }}/.bundled_gems'
- name: Install ruby dependencies
become: yes
shell:
cmd: |
if [ -f /usr/bin/yum ]; then
yum install ruby-devel gcc-c++ -y
elif [ -f /usr/bin/apt-get ]; then
apt-get install ruby-dev -y
fi
- name: Execute acceptance tests
shell:
cmd: |
gem install bundler --no-ri --no-rdoc --verbose --version '<2.0.0'
$GEM_HOME/bin/bundle install --retry 3
export BEAKER_set={{ nodeset }}
export BEAKER_debug=yes
export BEAKER_color=no
$GEM_HOME/bin/bundle exec rspec spec/acceptance
chdir: "{{ project_src_dir }}"
environment:
'GEM_HOME': "{{ ansible_user_dir }}/.bundled_gems"
'PUPPET_VERSION': "{{ puppet_version | default('4') }}"