Skip to content

Commit 5c30eea

Browse files
authored
Merge pull request #3 from billdodd/fix/issue-2
Revert playbooks to only use released Ansible 2.8 function
2 parents 277ca6e + 0b159ae commit 5c30eea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+50
-292
lines changed

OEM_EXTENSIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This document describes an approach for extending the standard Redfish Ansible m
88

99
## The Approach
1010

11-
With the current Redfish Ansible support, there are three main modules (`redfish_command.py`, `redfish_config.py` and `redfish_info.py`). These three modules are relatively thin modules that establish the commands and their parameters and then call out to a utility module, `redfish_utils.py`, that has the bulk of the logic to interact with the Redfish services.
11+
With the current Redfish Ansible support, there are three main modules (`redfish_command.py`, `redfish_config.py` and `redfish_facts.py`). These three modules are relatively thin modules that establish the commands and their parameters and then call out to a utility module, `redfish_utils.py`, that has the bulk of the logic to interact with the Redfish services.
1212

1313
The `redfish_utils.py` module implements a `RedfishUtils` class that has many methods to perform the various Redfish operations. With this architecture, a new vendor module that needs to add a specific Oem feature can create a new class (e.g. `ContosoRedfishUtils`) that extends the existing `RedfishUtils`. New method(s) can be added to that class (or existing methods overridden) while still being able to leverage all the existing standard methods in the parent class. Then a new vendor module (e.g. `contoso_redfish_command.py`) can be written that is basically a sparse version of `redfish_command.py` that only needs to handle the new or changed vendor commands.
1414

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ To use these playbooks, you first need to install Ansible (version 2.7 or later;
1212

1313
[Ansible Installation Guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
1414

15+
## Release process
16+
17+
The playbooks in the `master` branch of this repository are designed to work with the [latest stable release of Ansible](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html). The playbooks in the `devel` branch can have new and modified playbooks that reflect new features in the [Ansible devel branch](https://github.com/ansible/ansible/tree/devel).
18+
1519
## Running the playbooks
1620

1721
1. [Clone](https://help.github.com/en/articles/cloning-a-repository) this repository
@@ -36,9 +40,9 @@ The three Redfish modules are summarized here:
3640

3741
The `redfish_config` module performs OOB controller operations like setting the BIOS configuration.
3842

39-
3. [redfish_info](https://docs.ansible.com/ansible/devel/modules/redfish_info_module.html) (source: [redfish_info.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/remote_management/redfish/redfish_info.py))
43+
3. [redfish_facts](https://docs.ansible.com/ansible/latest/modules/redfish_facts_module.html) (source: [redfish_facts.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/remote_management/redfish/redfish_facts.py))
4044

41-
The `redfish_info` module retrieves information about the OOB controller like Systems inventory and Accounts inventory.
45+
The `redfish_facts` module retrieves information about the OOB controller like Systems inventory and Accounts inventory.
4246

4347
All three of the above modules use this utility module: [redfish_utils.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/redfish_utils.py)
4448

inventory.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ rootdir=~/inventory_files
2121
# Shorter name for inventory_hostname
2222
# Refers to the logical inventory hostname (example: redfish1)
2323
host="{{inventory_hostname}}"
24+
25+
# Vars for managing accounts
26+
id=3
27+
new_username=user3
28+
new_password=B1g$3cr3t
29+
roleid=Operator

playbooks/accounts/add_user.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
name: Add User
55
gather_facts: False
66

7-
vars:
8-
- account_username: user1
9-
- account_password: B1g$3cr3t
10-
- account_roleid: Operator
11-
127
tasks:
138

149
# When adding a user, it must be enabled afterwards
@@ -19,6 +14,7 @@
1914
baseuri: "{{ baseuri }}"
2015
username: "{{ username }}"
2116
password: "{{ password }}"
22-
account_username: "{{ account_username }}"
23-
account_password: "{{ account_password }}"
24-
account_roleid: "{{ account_roleid }}"
17+
id: "{{ id }}"
18+
new_username: "{{ new_username }}"
19+
new_password: "{{ new_password }}"
20+
roleid: "{{ roleid }}"

playbooks/accounts/delete_user.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
name: Delete User
55
gather_facts: False
66

7-
vars:
8-
- account_username: user1
9-
107
tasks:
118

129
- name: Delete user
@@ -16,4 +13,4 @@
1613
baseuri: "{{ baseuri }}"
1714
username: "{{ username }}"
1815
password: "{{ password }}"
19-
account_username: "{{ account_username }}"
16+
id: "{{ id }}"

playbooks/accounts/disable_user.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
name: Disable User
55
gather_facts: False
66

7-
vars:
8-
- account_username: user1
9-
107
tasks:
118

129
- name: Disable user
@@ -16,4 +13,4 @@
1613
baseuri: "{{ baseuri }}"
1714
username: "{{ username }}"
1815
password: "{{ password }}"
19-
account_username: "{{ account_username }}"
16+
id: "{{ id }}"

playbooks/accounts/enable_user.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
name: Enable User
55
gather_facts: False
66

7-
vars:
8-
- account_username: user1
9-
107
tasks:
118

129
- name: Enable user
@@ -16,4 +13,4 @@
1613
baseuri: "{{ baseuri }}"
1714
username: "{{ username }}"
1815
password: "{{ password }}"
19-
account_username: "{{ account_username }}"
16+
id: "{{ id }}"

playbooks/accounts/list_users.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
include_tasks: create_output_file.yml
1414

1515
- name: List all users
16-
redfish_info:
16+
redfish_facts:
1717
category: Accounts
1818
command: ListUsers
1919
baseuri: "{{ baseuri }}"

playbooks/accounts/update_user_password.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
name: Update user password
55
gather_facts: False
66

7-
vars:
8-
- account_username: user1
9-
- account_password: M0re$3cr3t
10-
117
tasks:
128

139
- name: Update user password
@@ -17,5 +13,5 @@
1713
baseuri: "{{ baseuri }}"
1814
username: "{{ username }}"
1915
password: "{{ password }}"
20-
account_username: "{{ account_username }}"
21-
account_password: "{{ account_password }}"
16+
id: "{{ id }}"
17+
new_password: "{{ new_password }}"

playbooks/accounts/update_user_role.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
name: Update user role
55
gather_facts: False
66

7-
vars:
8-
- account_username: user1
9-
- account_roleid: ReadOnly
10-
117
tasks:
128

139
- name: Update user role
@@ -17,5 +13,5 @@
1713
baseuri: "{{ baseuri }}"
1814
username: "{{ username }}"
1915
password: "{{ password }}"
20-
account_username: "{{ account_username }}"
21-
account_roleid: "{{ account_roleid }}"
16+
id: "{{ id }}"
17+
roleid: "{{ roleid }}"

0 commit comments

Comments
 (0)