- hosts: all tasks: - name: Prepare ssh config on the host to run 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 || -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 }}' - name: Run beaker shell: cmd: | trap "{{ ansible_user_dir }}/workspace/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 }} export BEAKER_debug=yes export BEAKER_color=no if [ -f Modulefile -o -f metadata.json ]; then if [ -f Modulefile ]; then MODULE=$(awk '/^name/ {print $NF}' Modulefile |tr -d \"\') elif [ -f metadata.json ]; then MODULE=$(python -c 'import json;print json.load(open("metadata.json"))["name"]') fi if [ -z "$MODULE" ]; then echo "Module name not defined in Modulefile or metadata.json" else mkdir -p "$MODULE" rsync -a --exclude="$MODULE" --exclude ".*" . "$MODULE" cd "$MODULE" fi fi mkdir .bundled_gems export GEM_HOME=`pwd`/.bundled_gems export GEM_BIN_DIR=$GEM_HOME/bin if [ -f Gemfile ]; then ruby <&1 --no-user-install fi chdir: '{{ ansible_user_dir }}/workspace' executable: /bin/bash environment: '{{ zuul | zuul_legacy_vars }}'