From 8cc0125e95bedbe9b922e5e0f2981f1c53d8033c Mon Sep 17 00:00:00 2001 From: Qin Wang Date: Wed, 31 Aug 2016 22:14:41 +0000 Subject: [PATCH] [docs] added a necessary arg for ansible command after removal of ansible.cfg ansible.cfg contains defaults, e.g., inventory. The command ansible galera_container -m shell -a "mysql \ -h localhost -e 'show status like \"%wsrep_cluster_%\";'" doesn't work without specifying inventory. This patch adds the sourcing of the openstack-ansible.rc file prior to executing any ansible commands. Change-Id: I59cd398e5f48f3b821ebd475bfe4069c0e142929 closes-bug: 1619062 --- doc/source/developer-docs/ops-galera-recovery.rst | 6 ++++++ doc/source/developer-docs/ops-galera-remove.rst | 1 + doc/source/developer-docs/ops-galera-start.rst | 1 + doc/source/install-guide/installation.rst | 5 +++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/source/developer-docs/ops-galera-recovery.rst b/doc/source/developer-docs/ops-galera-recovery.rst index 139edb48d3..2126220541 100644 --- a/doc/source/developer-docs/ops-galera-recovery.rst +++ b/doc/source/developer-docs/ops-galera-recovery.rst @@ -27,6 +27,7 @@ continue to process SQL requests. .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "mysql -h localhost \ -e 'show status like \"%wsrep_cluster_%\";'" node3_galera_container-3ea2cbd3 | FAILED | rc=1 >> @@ -68,6 +69,7 @@ recover cannot join the cluster because it no longer exists. .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "mysql \ -h localhost -e 'show status like \"%wsrep_cluster_%\";'" node2_galera_container-49a47d25 | FAILED | rc=1 >> @@ -118,6 +120,7 @@ recover cannot join the cluster because it no longer exists. .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "mysql \ -h localhost -e 'show status like \"%wsrep_cluster_%\";'" node3_galera_container-3ea2cbd3 | success | rc=0 >> @@ -154,6 +157,7 @@ the cluster have failed: .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "cat /var/lib/mysql/grastate.dat" node3_galera_container-3ea2cbd3 | success | rc=0 >> # GALERA saved state @@ -237,6 +241,7 @@ Recovering from certain failures require rebuilding one or more containers. .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "mysql \ -h localhost -e 'show status like \"%wsrep_cluster_%\";'" node3_galera_container-3ea2cbd3 | success | rc=0 >> @@ -277,6 +282,7 @@ Recovering from certain failures require rebuilding one or more containers. .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "mysql \ -h localhost -e 'show status like \"%wsrep_cluster_%\";'" node2_galera_container-49a47d25 | success | rc=0 >> diff --git a/doc/source/developer-docs/ops-galera-remove.rst b/doc/source/developer-docs/ops-galera-remove.rst index 961753ae9b..eebe66d976 100644 --- a/doc/source/developer-docs/ops-galera-remove.rst +++ b/doc/source/developer-docs/ops-galera-remove.rst @@ -8,6 +8,7 @@ In the following example, all but one node was shut down gracefully: .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "mysql -h localhost \ -e 'show status like \"%wsrep_cluster_%\";'" node3_galera_container-3ea2cbd3 | FAILED | rc=1 >> diff --git a/doc/source/developer-docs/ops-galera-start.rst b/doc/source/developer-docs/ops-galera-start.rst index 0c9c56b12d..2eb09f3c44 100644 --- a/doc/source/developer-docs/ops-galera-start.rst +++ b/doc/source/developer-docs/ops-galera-start.rst @@ -13,6 +13,7 @@ one of the nodes. .. code-block:: shell-session + # . /usr/local/bin/openstack-ansible.rc # ansible galera_container -m shell -a "cat /var/lib/mysql/grastate.dat" node2_galera_container-49a47d25 | success | rc=0 >> # GALERA saved state version: 2.1 diff --git a/doc/source/install-guide/installation.rst b/doc/source/install-guide/installation.rst index 0db0fe03e5..a4b4e284b9 100644 --- a/doc/source/install-guide/installation.rst +++ b/doc/source/install-guide/installation.rst @@ -89,8 +89,9 @@ Run playbooks .. code-block:: console - # ansible galera_container -m shell -a "mysql \ - -h localhost -e 'show status like \"%wsrep_cluster_%\";'" + # . /usr/local/bin/openstack-ansible.rc + # ansible galera_container -m shell \ + -a "mysql -h localhost -e 'show status like \"%wsrep_cluster_%\";'" Example output: