Commit Graph

677 Commits

Author SHA1 Message Date
ramishra 40198b1d86 Remove the leftover module in tripleo_common.actions
This completes all mistral related cleanup. There is
a doc patch in review to cleanup the docs.

Depends-On: https://review.opendev.org/c/openstack/python-tripleoclient/+/792137
Change-Id: Ib333408a95011882e10e15d66908b72884576949
2021-05-19 18:34:06 +05:30
ramishra 35c509602e Remove all mistral actions from tripleo-common
This removes dependency with msitral-lib.

Depends-On: https://review.opendev.org/c/openstack/tripleo-ansible/+/778018
Depends-On: https://review.opendev.org/c/openstack/python-tripleoclient/+/777950
Change-Id: I3c94845b2aa484ac7b4e8f444509ceac40fa289d
2021-03-01 21:27:08 +05:30
ramishra 50a24d529b Convert AnsiblePlaybookAction to utility
Not used as mistral action as mistral has been
removed from undercloud.

Change-Id: I93b2c82e9451bd68955040f09ec9eb97db7c0098
2021-03-01 17:40:47 +05:30
Zuul b0bcab90a2 Merge "Drop inject_facts_as_vars" 2021-02-25 04:32:48 +00:00
Zuul a3b2d77bdd Merge "Reduce fact gathering" 2021-02-22 19:50:13 +00:00
Alex Schultz 16bc02326b Drop inject_facts_as_vars
This setting stops ansible from converting ansible_fact items into top
level ansible_* vars. This has a huge impact on performance as this is
performed at the end of every task execution.

Depends-On: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/776659
Depends-On: https://review.opendev.org/c/openstack/tripleo-ansible/+/776666
Change-Id: I1a3c0d31cdb4a644cb950ca59c83bfcb051dc39d
2021-02-22 10:59:45 -07:00
Alex Schultz 0e81eb420e Reduce fact gathering
This change updates the default subset to only be the minimum list of
facts for ansible.  In the deployment we need to make sure that we only
collect the minimum amount of facts to perform the tasks at hand rather
than assume we have all the facts.

Depends-On: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/775709
Depends-On: https://review.opendev.org/c/openstack/tripleo-ansible/+/775708
Related-Bug: #1915761
Change-Id: I61affe32dfc9eacbe514893168397c9b291b8713
2021-02-19 07:38:44 -07:00
ramishra 0b8717e0c8 Cleanup dead mistral actions and workbooks
- Removes unused mistral actions
- All mistral workbooks
- Custom filter for undercloud nova
- mistral entry points as we don't have mistral

Depends-On: https://review.opendev.org/c/openstack/python-tripleoclient/+/775749
Change-Id: I7f826da829bbc7d7a4fcde8afcea3f61742a316a
2021-02-17 20:32:01 +05:30
Sorin Sbarnea 4db1e72654 pylint: fixed conditions
Change-Id: I0e6bcebca55d89bdfb59944bf91f4f9949c95562
2021-01-11 17:14:06 +05:30
Zuul d9c3e3c618 Merge "Lower ansible poll interval time" 2020-10-16 20:06:30 +00:00
Mathieu Bultel d2b373dc1d Add both validations path for inflight validation
The ceph external deploy tasks is using validation modules via
mistral.
We need to setup the correct new path for mistral in order to
get the module. (warn.py)

Change-Id: Ide21daaac9a558561d0943cc0a380952cf7e29b3
Resolves: rhbz#1885828
2020-10-07 12:38:49 +02:00
Alex Schultz d449a9ea07 Lower ansible poll interval time
Currently we set poll interval in ansible to 0.05 which means it'll wait
50ms.  The default is 0.001 which at scale is too cpu intensive.  That
being said, waiting 50ms for each task across all hosts increases
overall execution time. Let's lower it to 0.01 as a middle ground
between the current 0.05 and the 0.001 default.

Change-Id: Ie4268fcc8c1a8031eaf7c33e9c137c198017ee18
2020-10-02 10:27:57 +00:00
Zuul 76121bf896 Merge "Adjust Ansible forks caculations" 2020-09-23 07:35:50 +00:00
Zuul cb84a8c38c Merge "Lower default verbosity for ansible" 2020-09-21 22:12:59 +00:00
Alex Schultz e8e2ca479f Lower default verbosity for ansible
Similar to aef369e7b4d38e4ca7eb158d2878e84a4b93e603 however this only
affects the ansible-playbook execution. By default openstack cli sets
verbosity to 1 so we are always running ansible-playbook with a -v. This
can a consequence on the information returned during execution as we may
get extra result data in the output.

Change-Id: I4e1cb6658172a7da5ae5198ba55d47de33282975
2020-09-15 09:51:07 -06:00
Jaganathan Palanisamy 225d48ffca Move get network configs action to utils
This changes to move get network configs action to utils.
Need this changes for derive parameters ansible changes.

Change-Id: Ia18eab278b4d6c66b97eb6722ac196b2002e008c
2020-09-11 10:37:08 +05:30
Luke Short 9e9948e7ed Adjust Ansible forks caculations
Using a multiple of 10 can be excessive on resource usage. It has now
been lowered to 4. The default maximum will also no longer exceed 100.

Change-Id: I57345d5b100efce143fa940b56c81f5e6bc6c390
Signed-off-by: Luke Short <ekultails@gmail.com>
2020-09-10 15:58:13 -04:00
Alex Schultz 781233af1a Fix config parser warning
/usr/lib/python3.6/site-packages/tripleo_common/actions/ansible.py:154:
DeprecationWarning: This method will be removed in future versions.  Use
'parser.read_file()' instead.
  config.readfp(sio_cfg)

Change-Id: Ibd33a26feae03e4f0d46370346b7a950d1f6b02c
2020-08-19 13:55:48 -06:00
Emilien Macchi 76bc13e3bf ansible: limit_hosts now takes precedence over blacklisted_hostnames
From now, limit_hosts will take precedence over the blacklisted_hostnames.
And therefore Ansible won't be run with two --limit if both limit hosts
and blacklisted hostnames are in use. When we want to run Ansible on
specific hosts, we will ignore the blacklisted nodes and assume we know
what we do. In the case of the scale-down scenario, the unreachable nodes
are ignored.

Note: adding unit tests coverage for both parameters.

Change-Id: I2e9fc7b9e9005fce7d956f1b936054e540b39849
Closes-Bug: #1857298
2020-07-15 14:11:20 -04:00
Emilien Macchi c1dad1ced1 Add tripleo_states to default callback whitelist
tripleo_states will be a useful callback to print out informations about
a deployment state (e.g. if a node failed but was ignored because of
max_failed_percentage).

Depends-On: https://review.opendev.org/735962
Change-Id: I82f4945bf1178fad1ff511c994518008f308d12e
2020-07-07 11:32:50 +00:00
Zuul a5c4129340 Merge "Fix stdout_callback" 2020-07-03 20:50:35 +00:00
Zuul a4f244284f Merge "Remove Validations Mistral Workflows" 2020-06-23 11:44:13 +00:00
Zuul 9549c60c80 Merge "Revert "Revert "Remove config-download related mistral actions""" 2020-06-23 05:16:51 +00:00
Alex Schultz ed3fdb7764 Fix stdout_callback
We switched to tripleo_dense but the default ansible.cfg that is created
still has tripleo.

Change-Id: I1fcf0aa3212d037db7c4d9baed18959ed6a0cc81
2020-06-22 15:09:32 +00:00
Gael Chamoulaud 8ea44dbd94 Remove Validations Mistral Workflows
This patch removes the following Validations workflows:
- tripleo.validations.list_groups
- tripleo.validations.list_validations
- tripleo.validations.run_validation
- tripleo.validations.upload

The following workflows still remain in charge and will be migrated
in a follow up patch:
- tripleo.validation.get_pubkey
- tripleo.validation.get_privkey
- tripleo.validation.enable

Depends-On: https://review.rdoproject.org/r/#/c/23700/
Change-Id: Ie36926e47cc46d5852a098f9e583169e7b1dcd7d
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2020-06-22 13:29:43 +00:00
Emilien Macchi 9f499a2294 Revert "Revert "Remove config-download related mistral actions""
This reverts commit c915208fee.

Change-Id: Iceebfd796f4b2501495ffd253e8b83bad4dd727a
2020-06-19 16:47:35 +00:00
Emilien Macchi c915208fee Revert "Remove config-download related mistral actions"
See bug report, it broke tripleoclient.

This reverts commit 2c47084bc9.
Related-Bug: #1884138

Change-Id: Ib86c92a9607a42f5a743d69026f37efcadb55553
2020-06-18 20:48:10 +00:00
Zuul e695cd8fbb Merge "Remove config-download related mistral actions" 2020-06-15 16:08:00 +00:00
Zuul c3db8fa9e9 Merge "Remove AnsibleGenerateInventoryAction mistal action" 2020-06-15 16:07:58 +00:00
Rabi Mishra 2c47084bc9 Remove config-download related mistral actions
Depends-On: https://review.opendev.org/#/c/729251/
Change-Id: I493ec949e09a1a1a1745f4bf161bc6d3dc185e1e
2020-06-09 13:50:39 +05:30
Rabi Mishra b471d2cdcc Remove AnsibleGenerateInventoryAction mistal action
Not used anymore.

Change-Id: If5053530eeadd277db091d60bc9095aa7f05d67f
2020-06-09 11:50:21 +05:30
Zuul ed7049ee84 Merge "Switch to tripleo_dense" 2020-05-30 09:17:24 +00:00
Zuul fe8ab8cb92 Merge "Switch to tripleo stdout callback" 2020-05-29 06:36:08 +00:00
Zuul 1e3c4044cc Merge "Change generate_ansible_inventory() arguments" 2020-05-27 09:43:31 +00:00
Rabi Mishra d0c60a280f Change generate_ansible_inventory() arguments
Mistral context.security auth attributes are not same as the
keystone auth plugins. Use the attributes directly in
generate_ansible_inventory() function.

This will help us to move to using ansible module.

Change-Id: I83856119ea53e39d1891c3f7d94a4d5645da0046
2020-05-21 19:52:52 +05:30
Zuul 96472644b2 Merge "Remove tripleo.deployment.overcloudrc action" 2020-05-21 09:16:12 +00:00
Rabi Mishra 4349f209b9 Remove tripleo.deployment.overcloudrc action
We now use a playbook to generate rc files.

Change-Id: Ida0858ff7b401633edefe6603ef061bd0165d6f4
2020-05-13 13:39:07 +05:30
Alex Schultz 0186702a41 Switch to tripleo_dense
Change-Id: Iff8eec43bd73bc6486f56e741e740869d1b8acbb
Depends-On: https://review.opendev.org/#/c/726479/
2020-05-08 15:59:40 -06:00
Alex Schultz b3c87dda23 Switch to tripleo stdout callback
In order to improve the UX and prevent confusion during the async status
output, we need to write a custom callback to change the text.

See See also https://github.com/ansible/ansible/issues/63926

Change-Id: Ie3021ddfe1b4ca304cfd34a46fd4e4c7e9c62e9f
Depends-On: https://review.opendev.org/#/c/725665/
2020-05-05 12:53:55 -06:00
Alex Schultz ffb1ac86a4 Switch fact caching connection
For the jsonfile plugin, the path should be a local directory. This
directory needs to be readable by any user that would execute the
playbook. Since /var/lib/mistral may not be world readable, we should
use something in the user's home dir instead.  This changes it to
~/.ansible/fact_cache

Change-Id: I8fa7127cf9ebb51ce4f090670ec2a45bcfcf77e8
Closes-Bug: #1873480
2020-05-04 04:24:17 +00:00
Rabi Mishra 9292d5285a Remove some unsed actions
- tripleo_common.actions.files:MakeTempDir
- tripleo_common.actions.files:RemoveTempDir
- tripleo_common.actions.package_update:UpdateStackAction

Change-Id: Iae9c08741011c532a5a51be83ffcc00e6a6088ad
2020-04-29 14:43:40 +05:30
Rabi Mishra 3952924859 Refactor ansible inventory generation
- Removes the incorrect swift_url lookup
- Removes the usage of session object
- Removes os_auth_token for undercloud
- Moves the code to inventory module for it to be used in ansible
module

Change-Id: I3cdce51764a27a389e008832ed366b6346c4f0e0
2020-04-28 19:13:15 +05:30
Zuul 131f4aad89 Merge "Remove GetDeploymentFailuresAction" 2020-04-23 17:05:31 +00:00
Zuul 4ff0e6c7bf Merge "Move *OvercloudConfigAction functionality to utils" 2020-04-23 17:05:29 +00:00
Zuul ff01e0b2e0 Merge "Move OvercloudRcAction functionality to utils" 2020-04-23 17:05:26 +00:00
Zuul 9d42b49a9e Merge "Remove DeploymentStatusAction" 2020-04-23 01:14:09 +00:00
Zuul 3863b24736 Merge "Only add non-empty blacklisted hostnames." 2020-04-20 00:53:02 +00:00
Rabi Mishra b8e07ea4bc Remove GetDeploymentFailuresAction
The tripleoclient command to get the ansible failures using
mistral api has been removed in the dependant patch.

Depends-On: https://review.opendev.org/720345
Change-Id: Ife5c2b41f7cfc48f5b648ea8647457efeaadcacb
2020-04-16 10:56:41 +05:30
Rabi Mishra 2a65204f37 Move *OvercloudConfigAction functionality to utils
Change-Id: I127df51c608a5f89548f12f18faf9bddb42de1d6
2020-04-15 15:20:35 +05:30
Rabi Mishra 315174ce38 Move OvercloudRcAction functionality to utils
This would help us use it in ansible modules and
playbooks.

Change-Id: I7adf08fa31722539de8d536eca34d3500c5ac6e8
2020-04-15 10:02:27 +05:30