Role - tripleo-transfer

Role Documentation

Welcome to the “tripleo-transfer” role documentation.

Role Defaults

This section highlights all of the defaults and variables set within the “tripleo-transfer” role.

# All variables intended for modification should place placed in this file.


# Required variables:
#   * `tripleo_transfer_src_host` -- the inventory name of the source host
#   * `tripleo_transfer_src_dir` -- directory on the source host to transfer from
#   * `tripleo_transfer_dest_host` -- the inventory name of the destination host
#   * `tripleo_transfer_dest_dir` -- directory on the destination host to transfer to
tripleo_transfer_src_become: true
tripleo_transfer_dest_become: true
tripleo_transfer_flag_file:
# tripleo_transfer_key_location: location of the private key used to connect
# from src host to dest host.
tripleo_transfer_key_location: ~/transfer_key
# tripleo_transfer_cleanup_keys: clean up the keypair from the source host
# and remove public key from destination host when true.
tripleo_transfer_cleanup_keys: true
# tripleo_transfer_exclude: a list of patterns to selectively exclude
# some files from the transfer to the destination host.
tripleo_transfer_exclude: []
# tripleo_transfer_include: a list of patterns to selectively include
# some files from the transfer to the destination host. Files in this list
# are not filtered out with tripleo_transfer_exclude.
tripleo_transfer_include: []
# tripleo_transfer_sync_options: override default transfer options
tripleo_transfer_sync_options: --delay-updates -F --ignore-times --compress --archive
  --delete

Role Variables: main.yml

# All variables intended for internal use should be placed in this file.


# make sure we have a trailing forward slash in the src, otherwise rsync creates extra dir
tripleo_transfer_src_dir_safe: '{{ tripleo_transfer_src_dir }}/'

# make sure we do not have a trailing forward slash in the dest
tripleo_transfer_dest_dir_safe: "{{ tripleo_transfer_dest_dir | regex_replace('\\\
  /$', '') }}"

Molecule Scenarios

Molecule is being used to test the “tripleo-transfer” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: default

Driver: delegated
Molecule Options
managed: false
login_cmd_template: >-
  ssh
  -o UserKnownHostsFile=/dev/null
  -o StrictHostKeyChecking=no
  -o Compression=no
  -o TCPKeepAlive=yes
  -o VerifyHostKeyDNS=no
  -o ForwardX11=no
  -o ForwardAgent=no
  {instance}
ansible_connection_options:
  ansible_connection: ssh
Molecule Inventory
hosts:
  all:
    hosts:
      controller1:
        ansible_host: 127.0.0.2
      controller2:
        ansible_host: 127.0.0.3
Example default playbook
- name: Collect facts
  hosts: all
  gather_facts: false
  any_errors_fatal: true
  tasks:
  - name: Gather a minimal set of facts
    setup:
      gather_subset: '!all,min'

- name: Converge
  hosts: localhost
  connection: local
  any_errors_fatal: true
  roles:
  - role: tripleo-transfer
    tripleo_transfer_src_host: controller2
    tripleo_transfer_src_dir: /etc
    tripleo_transfer_dest_host: controller1
    tripleo_transfer_dest_dir: /opt/etc-target