Skip to content

Commit

Permalink
Rename activation and activation_info modules (#318)
Browse files Browse the repository at this point in the history
* Rename activation module to rulebook_activation. Rename activation_info module to rulebook_activation_info.

Signed-off-by: Alina Buzachis <[email protected]>

* Add changelog fragment

Signed-off-by: Alina Buzachis <[email protected]>

* Fix sanity

* Rebase

Signed-off-by: Alina Buzachis <[email protected]>

---------

Signed-off-by: Alina Buzachis <[email protected]>
Co-authored-by: Alex <[email protected]>
  • Loading branch information
alinabuzachis and Alex-Izquierdo authored Sep 16, 2024
1 parent 3305b75 commit 23808fa
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .config/manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ plugins/doc_fragments/
plugins/doc_fragments/eda_controller.py
plugins/doc_fragments/__init__.py
plugins/modules/
plugins/modules/activation.py
plugins/modules/activation_info.py
plugins/modules/controller_token.py
plugins/modules/credential.py
plugins/modules/credential_info.py
Expand All @@ -87,6 +85,8 @@ plugins/modules/event_stream.py
plugins/modules/event_stream_info.py
plugins/modules/project.py
plugins/modules/project_info.py
plugins/modules/rulebook_activation.py
plugins/modules/rulebook_activation_info.py
plugins/modules/rulebook_info.py
plugins/modules/user.py
plugins/modules/__init__.py
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ You can either call modules, rulebooks and playbooks by their Fully Qualified Co
```yaml
---
- name: Create a rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "Example Activation"
description: "Example Activation description"
project: "Example Project"
rulebook_name: "basic_short.yml"
decision_environment_name: "Example Decision Environment"
enabled: False
awx_token_id: 1
awx_token_name: "Example AWX Token"

- name: Get information about the rulebook activation
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:
name: "Example Activation"

- name: Delete rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "Example Activation"
state: absent
```
Expand Down
18 changes: 18 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,22 @@ action_groups:
- project
- project_info
- rulebook_info
- rulebook_activation
- rulebook_activation_info
- user
plugin_routing:
modules:
activation:
redirect: ansible.eda.rulebook_activation
deprecation:
removal_version: 4.0.0
warning_text: >-
activation has been renamed to rulebook_activation.
Please update your tasks.
activation_info:
redirect: ansible.eda.rulebook_activation_info
deprecation:
removal_version: 4.0.0
warning_text: >-
activation_info has been renamed to rulebook_activation_info.
Please update your tasks.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

DOCUMENTATION = """
---
module: activation
module: rulebook_activation
author:
- "Nikhil Jain (@jainnikhil30)"
- "Alina Buzachis (@alinabuzachis)"
Expand Down Expand Up @@ -145,7 +145,7 @@

EXAMPLES = """
- name: Create a rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "Example Rulebook Activation"
description: "Example Rulebook Activation description"
project_name: "Example Project"
Expand All @@ -155,7 +155,7 @@
awx_token_name: "Example Token"
- name: Create a rulebook activation with event_streams option
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "Example Rulebook Activation"
description: "Example Activation description"
project_name: "Example Project"
Expand All @@ -169,7 +169,7 @@
source_name: "Sample source"
- name: Delete a rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "Example Rulebook Activation"
state: absent
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

DOCUMENTATION = """
---
module: activation_info
module: rulebook_activation_info
author:
- Alina Buzachis (@alinabuzachis)
short_description: List rulebook activations in the EDA Controller
Expand All @@ -31,11 +31,11 @@

EXAMPLES = """
- name: Get information about a rulebook activation
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:
name: "Example Rulebook Activation"
- name: List all rulebook activations
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:
"""


Expand Down
32 changes: 16 additions & 16 deletions tests/integration/targets/activation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
register: decision_environment_creation

- name: Create a new rulebook activation in check mode
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -156,7 +156,7 @@
- _result.changed

- name: Create a new rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -173,7 +173,7 @@
- _result.changed

- name: Create a new rulebook activation again
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -191,19 +191,19 @@
- "'A rulebook activation with name: ' + activation_name + ' already exists. The module does not support modifying a rulebook activation.' in _result.msg"

- name: Get information about the rulebook activation
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:
name: "{{ activation_name }}"

- name: List all the rulebook activations
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:

- name: Delete rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name }}"
state: absent

- name: Get information about the rulebook activation
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:
name: "{{ activation_name }}"

# Test event_streams option
Expand Down Expand Up @@ -235,7 +235,7 @@
register: _result_rulebook_info

- name: Create a rulebook activation (wrong source_name)
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name_wrong_source }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -257,7 +257,7 @@
- '"The specified source_name Test source name does not exist." in _result.msg'

- name: Create a rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name_source_index }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -277,7 +277,7 @@
- _result.changed

- name: Get information about the rulebook activation
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:
name: "{{ activation_name_source_index }}"
register: _result_activation_info

Expand All @@ -291,12 +291,12 @@
- event_stream_name in (source_mappings_dict | map(attribute='event_stream_name') | list)

- name: Delete rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name_source_index }}"
state: absent

- name: Create a new rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name_source_name }}"
description: "Example Activation description"
project_name: "{{ project_name }}"
Expand All @@ -316,7 +316,7 @@
- _result.changed

- name: Get information about the rulebook activation
ansible.eda.activation_info:
ansible.eda.rulebook_activation_info:
name: "{{ activation_name_source_name }}"
register: _result_activation_info

Expand Down Expand Up @@ -354,7 +354,7 @@
- credential_deletion is success

- name: Delete rulebook activation
ansible.eda.activation:
ansible.eda.rulebook_activation:
name: "{{ activation_name }}"
state: absent

Expand All @@ -371,8 +371,8 @@
state: absent
ignore_errors: true

- name: Delete rulebook activations
ansible.eda.activation:
- name: Delete rulebook activation
ansible.eda.rulebook_activation:
name: "{{ item }}"
state: absent
loop:
Expand Down

0 comments on commit 23808fa

Please sign in to comment.