Merge "Ignore Ansible warnings for mount/tar"

This commit is contained in:
Jenkins 2017-06-30 00:38:25 +00:00 committed by Gerrit Code Review
commit 9ad5dbbf92
2 changed files with 8 additions and 1 deletions

View File

@ -25,12 +25,15 @@
state: "absent" state: "absent"
# This is using a shell command because the ansible archive module does not # This is using a shell command because the ansible archive module does not
# provide for the options needed to properly create an LXC image archive. # provide for the options needed to properly create an LXC image archive.
# Ansible will print a warning since this task calls 'tar' directly and we
# suppress this warning with 'warn: no'.
- name: Create lxc image - name: Create lxc image
shell: | shell: |
tar -Opc -C {{ lxc_image_cache_path }} . | {{ lxc_xz_bin }} -{{ lxc_image_compression_ratio }} -c - > rootfs.tar.xz tar -Opc -C {{ lxc_image_cache_path }} . | {{ lxc_xz_bin }} -{{ lxc_image_compression_ratio }} -c - > rootfs.tar.xz
args: args:
chdir: "{{ cache_path_fact }}/" chdir: "{{ cache_path_fact }}/"
warn: no
tags: tags:
- skip_ansible_lint - skip_ansible_lint

View File

@ -95,8 +95,12 @@
when: when:
- machine1_conf | changed - machine1_conf | changed
# Ignore the Ansible warning here about using 'mount' via the shell module
# instead of using the mount Ansible module.
- name: Mount all - name: Mount all
shell: "mount | grep '/var/lib/machines' || (systemctl start var-lib-machines.mount && exit 3)" shell: "mount | grep '/var/lib/machines' || (systemctl start var-lib-machines.mount && exit 3)"
args:
warn: no
register: mount_machines register: mount_machines
changed_when: mount_machines.rc == 3 changed_when: mount_machines.rc == 3
failed_when: mount_machines.rc not in [0, 3] failed_when: mount_machines.rc not in [0, 3]