X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fansible.sh;h=3beca3fba43c14434436a6560c43fd45357cc97a;hp=1263412dd51ca6acab9eecce2bf563ca6c9c365f;hb=df5672b3d9c29b51397f4770eb992c9f3f3955ce;hpb=dbffa6cfb6fb83285f7d6b9f38648a42cfe08de5 diff --git a/resources/libraries/bash/function/ansible.sh b/resources/libraries/bash/function/ansible.sh index 1263412dd5..3beca3fba4 100644 --- a/resources/libraries/bash/function/ansible.sh +++ b/resources/libraries/bash/function/ansible.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -22,7 +22,7 @@ function ansible_adhoc () { # # Variable read: # - ${WORKING_TOPOLOGY} - Reserved working topology. - # - ${TOOLS_DIR} - CSIT tools directory, where testbed-setup is located. + # - ${CSIT_DIR} - CSIT main directory, where ansible playbooks are located. set -exuo pipefail @@ -33,10 +33,11 @@ function ansible_adhoc () { hosts=($(fgrep host "${WORKING_TOPOLOGY}" | cut -d ":" -f 2)) || { die "Failed to read hosts from working topology!" } - pushd "${TOOLS_DIR}"/testbed-setup/ansible || die "Pushd failed!" - ANSIBLE_STDOUT_CALLBACK=yaml \ - ANSIBLE_PIPELINING=true \ - ansible \ + pushd "${CSIT_DIR}"/fdio.infra.ansible || die "Pushd failed!" + export ANSIBLE_HOST_KEY_CHECKING=False + export ANSIBLE_STDOUT_CALLBACK=yaml + export ANSIBLE_PIPELINING=true + ansible-playbook \ --vault-password-file=vault_pass \ --extra-vars '@vault.yml' \ --inventory inventories/lf_inventory/hosts site.yaml \ @@ -53,7 +54,7 @@ function ansible_playbook () { # # Variable read: # - ${WORKING_TOPOLOGY} - Reserved working topology. - # - ${TOOLS_DIR} - CSIT tools directory, where testbed-setup is located. + # - ${CSIT_DIR} - CSIT main directory, where ansible playbooks are located. set -exuo pipefail @@ -64,10 +65,11 @@ function ansible_playbook () { hosts=($(fgrep host "${WORKING_TOPOLOGY}" | cut -d ":" -f 2)) || { die "Failed to read hosts from working topology!" } - pushd "${TOOLS_DIR}"/testbed-setup/ansible || die "Pushd failed!" - ANSIBLE_STDOUT_CALLBACK=yaml \ - ANSIBLE_PIPELINING=true \ - ansible-playbook \ + pushd "${CSIT_DIR}"/fdio.infra.ansible || die "Pushd failed!" + export ANSIBLE_HOST_KEY_CHECKING=False + export ANSIBLE_STDOUT_CALLBACK=yaml + export ANSIBLE_PIPELINING=true + ansible-playbook \ --vault-password-file=vault_pass \ --extra-vars '@vault.yml' \ --inventory inventories/lf_inventory/hosts site.yaml \