playbooks: replace ansible_ssh_user with ansible_user

ansible_ssh_user has been deprecated since Ansible 2.0 [1]

[1] https://github.com/ansible/ansible/blob/stable-2.0/CHANGELOG.md

Change-Id: If1ef202b41af124637091a3527320b80734948fe
This commit is contained in:
Alistair Coles 2022-10-11 11:27:03 +01:00
parent 3ad39cd0b8
commit 07b5f139a5
5 changed files with 15 additions and 15 deletions

View File

@ -69,7 +69,7 @@
- hosts: test-runner
tasks:
- name: add new env. variable for running tests
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/home/{{ ansible_ssh_user}}/test.conf"
lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/home/{{ ansible_user}}/test.conf"
- name: copy the sample configuration files for running tests
template: src=test.conf.j2 dest=/home/{{ ansible_ssh_user }}/test.conf
template: src=test.conf.j2 dest=/home/{{ ansible_user }}/test.conf

View File

@ -126,20 +126,20 @@
when: previous_swift_version | default(latest_swift_release.stdout) is not match("^(rocky|stein|train|ussuri)-em.*|^2\.(1?[0-9]|2[0-5])\.|^(origin/)?stable/[a-u].*")
- name: create remakerings from template
template: src=make_multinode_rings.j2 dest=/home/{{ ansible_ssh_user }}/make_multinode_rings mode=0755
template: src=make_multinode_rings.j2 dest=/home/{{ ansible_user }}/make_multinode_rings mode=0755
- name: create rings dir
file: >
path=/home/{{ ansible_ssh_user }}/rings
path=/home/{{ ansible_user }}/rings
state=directory
- name: make rings
shell:
cmd: /home/{{ ansible_ssh_user }}/make_multinode_rings
cmd: /home/{{ ansible_user }}/make_multinode_rings
executable: /bin/bash
- name: scp rings to all swift-cluster nodes
command: scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o ConnectionAttempts=360 /home/{{ ansible_ssh_user }}/rings/{{ item[0] }} {{ ansible_ssh_user }}@{{ hostvars[item[1]].nodepool.public_ipv4 }}:/etc/swift
command: scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o ConnectionAttempts=360 /home/{{ ansible_user }}/rings/{{ item[0] }} {{ ansible_user }}@{{ hostvars[item[1]].nodepool.public_ipv4 }}:/etc/swift
with_nested:
- ['account.ring.gz', 'container.ring.gz', 'object.ring.gz', 'object-1.ring.gz', 'object-2.ring.gz']
- "{{ groups['swift-cluster'] }}"

View File

@ -40,4 +40,4 @@
tox_envlist: func-py3
tox_environment:
TOX_CONSTRAINTS_FILE: https://releases.openstack.org/constraints/upper/yoga
SWIFT_TEST_CONFIG_FILE: /home/{{ ansible_ssh_user }}/test.conf
SWIFT_TEST_CONFIG_FILE: /home/{{ ansible_user }}/test.conf

View File

@ -2,7 +2,7 @@
set -e
cd /home/{{ ansible_ssh_user }}/rings
cd /home/{{ ansible_user }}/rings
rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz

View File

@ -161,22 +161,22 @@
create: no
- name: copy the SAIO scripts for resetting the environment
command: cp -r {{ zuul.project.src_dir }}/doc/saio/bin /home/{{ ansible_ssh_user }}/bin creates=/home/{{ ansible_ssh_user }}/bin
command: cp -r {{ zuul.project.src_dir }}/doc/saio/bin /home/{{ ansible_user }}/bin creates=/home/{{ ansible_user }}/bin
- name: set the correct file mode for SAIO scripts
file: dest=/home/{{ ansible_ssh_user }}/bin mode=0777 recurse=yes
file: dest=/home/{{ ansible_user }}/bin mode=0777 recurse=yes
- name: add new env. variable for loopback device
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export SAIO_BLOCK_DEVICE=/srv/swift-disk"
lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export SAIO_BLOCK_DEVICE=/srv/swift-disk"
- name: remove line from resetswift
lineinfile: dest=/home/{{ ansible_ssh_user }}/bin/resetswift line="sudo find /var/log/swift -type f -exec rm -f {} \;" state=absent
lineinfile: dest=/home/{{ ansible_user }}/bin/resetswift line="sudo find /var/log/swift -type f -exec rm -f {} \;" state=absent
- name: add new env. variable for running tests
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf"
lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf"
- name: make sure PATH includes the bin directory
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export PATH=${PATH}:/home/{{ ansible_ssh_user }}/bin"
lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export PATH=${PATH}:/home/{{ ansible_user }}/bin"
- name: increase open files limit to run probe tests
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="ulimit -n 4096"
lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="ulimit -n 4096"