On Tue, Feb 23, 2021 at 03:01:50PM +0000, Alex Bennée wrote: > > Alex Bennée writes: > > > Cleber Rosa writes: > > > >> To run basic jobs on custom runners, the environment needs to be > >> properly set up. The most common requirement is having the right > >> packages installed. > >> > > > > > So I got somewhat there with a direct command line invocation: > > > > ansible-playbook -u root -i 192.168.122.24,192.168.122.45 scripts/ci/setup/build-environment.yml -e 'ansible_python_interpreter=/usr/bin/python3' > > > > although for some reason a single host -i fails... > > > >> diff --git a/scripts/ci/setup/build-environment.yml b/scripts/ci/setup/build-environment.yml > >> new file mode 100644 > >> index 0000000000..0197e0a48b > >> --- /dev/null > >> +++ b/scripts/ci/setup/build-environment.yml > >> @@ -0,0 +1,76 @@ > >> +--- > >> +- name: Installation of basic packages to build QEMU > >> + hosts: all > >> + tasks: > >> + - name: Update apt cache > >> + apt: > >> + update_cache: yes > >> + when: > >> + - ansible_facts['distribution'] == 'Ubuntu' > > > > So are we limiting to Ubuntu here rather than say a Debian base? > > Also I'm getting: > > TASK [Update apt cache] ***************************************************************************************************************************************************** > fatal: [hackbox-ubuntu-2004]: FAILED! => {"msg": "The conditional check 'ansible_facts['distribution'] == 'Ubuntu'' failed. The error was: error while evaluating conditional (ansible_facts['distribution'] == 'Ubuntu'): 'dict object' has no attribute 'distribution'\n\nThe error appears to have been in '/home/alex/lsrc/qemu.git/scripts/ci/setup/build-environment.yml': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name: Update apt cache\n ^ here\n"} > > which is odd given that machine is definitely an Ubuntu one. > It's defintely odd. This is what I get on a fresh machine: TASK [Update apt cache] ************************************************************************************************************************* [WARNING]: Updating cache and auto-installing missing dependency: python3-apt ok: [localhost] Could you please let me know the output of: $ ansible -m setup -u $YOUR_USERNAME -i $HOSTNAME, all | grep ansible_distribution Thanks, - Cleber.