From: Tomas Krizek Date: Mon, 7 Jan 2019 16:30:16 +0000 (+0100) Subject: distro/tests: select corect Python interpreter for ansible X-Git-Tag: v3.2.1~2^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d06399f92b1e167769b1d2ec2bbd53482d0d545b;p=thirdparty%2Fknot-resolver.git distro/tests: select corect Python interpreter for ansible --- diff --git a/distro/tests/centos7/Vagrantfile b/distro/tests/centos7/Vagrantfile index df39e1810..a03e59996 100644 --- a/distro/tests/centos7/Vagrantfile +++ b/distro/tests/centos7/Vagrantfile @@ -10,6 +10,9 @@ Vagrant.configure(2) do |config| config.vm.define "centos7_knot-resolver" do |machine| machine.vm.provision "ansible" do |ansible| ansible.playbook = "../knot-resolver-test.yaml" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python2" + } end end diff --git a/distro/tests/fedora28/Vagrantfile b/distro/tests/fedora28/Vagrantfile index 72733f226..0171b4fdd 100644 --- a/distro/tests/fedora28/Vagrantfile +++ b/distro/tests/fedora28/Vagrantfile @@ -10,6 +10,9 @@ Vagrant.configure(2) do |config| config.vm.define "fedora28_knot-resolver" do |machine| machine.vm.provision "ansible" do |ansible| ansible.playbook = "../knot-resolver-test.yaml" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python3" + } end end diff --git a/distro/tests/fedora29/Vagrantfile b/distro/tests/fedora29/Vagrantfile index 8b41f5396..67407e871 100644 --- a/distro/tests/fedora29/Vagrantfile +++ b/distro/tests/fedora29/Vagrantfile @@ -10,6 +10,9 @@ Vagrant.configure(2) do |config| config.vm.define "fedora29_knot-resolver" do |machine| machine.vm.provision "ansible" do |ansible| ansible.playbook = "../knot-resolver-test.yaml" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python3" + } end end diff --git a/distro/tests/knot-resolver-test.yaml b/distro/tests/knot-resolver-test.yaml index b049ee589..33d07aa6d 100644 --- a/distro/tests/knot-resolver-test.yaml +++ b/distro/tests/knot-resolver-test.yaml @@ -5,7 +5,6 @@ become: true vars: - ansible_python_interpreter: /usr/bin/python2 dig_package: Debian: dnsutils Ubuntu: dnsutils @@ -51,16 +50,12 @@ vars_files: - repos.yaml - # HACK: Ansible requires Python 2, but it's not installed by default in all distros gather_facts: false pre_tasks: - - name: install python and deps for ansible modules + - name: install python3 (Arch) raw: | - yum install -y python2 python2-dnf libselinux-python || \ - pacman -Sy python2 --noconfirm || \ - (zypper --gpg-auto-import-keys refresh && zypper install -y python) || \ - (apt-get update && apt-get install -y python) || \ - : + (pacman-key --init && pacman-key --populate archlinux && \ + pacman -Sy python3 --noconfirm) || : ignore_errors: true - name: gather facts setup: diff --git a/distro/tests/ubuntu1604/Vagrantfile b/distro/tests/ubuntu1604/Vagrantfile index 83e4588dd..40e049222 100644 --- a/distro/tests/ubuntu1604/Vagrantfile +++ b/distro/tests/ubuntu1604/Vagrantfile @@ -10,6 +10,9 @@ Vagrant.configure(2) do |config| config.vm.define "ubuntu1604_knot-resolver" do |machine| machine.vm.provision "ansible" do |ansible| ansible.playbook = "../knot-resolver-test.yaml" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python3" + } end end diff --git a/distro/tests/ubuntu1804/Vagrantfile b/distro/tests/ubuntu1804/Vagrantfile index 73698d9ac..57e210d6e 100644 --- a/distro/tests/ubuntu1804/Vagrantfile +++ b/distro/tests/ubuntu1804/Vagrantfile @@ -10,6 +10,9 @@ Vagrant.configure(2) do |config| config.vm.define "ubuntu1804_knot-resolver" do |machine| machine.vm.provision "ansible" do |ansible| ansible.playbook = "../knot-resolver-test.yaml" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python3" + } end end diff --git a/distro/tests/ubuntu1810/Vagrantfile b/distro/tests/ubuntu1810/Vagrantfile index c763ea47e..c560be1f8 100644 --- a/distro/tests/ubuntu1810/Vagrantfile +++ b/distro/tests/ubuntu1810/Vagrantfile @@ -10,6 +10,9 @@ Vagrant.configure(2) do |config| config.vm.define "ubuntu1810_knot-resolver" do |machine| machine.vm.provision "ansible" do |ansible| ansible.playbook = "../knot-resolver-test.yaml" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python3" + } end end