Skip to content

Commit 8edea56

Browse files
committed
Ansible Integration V1.2
1 parent b1d3878 commit 8edea56

Some content is hidden

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

44 files changed

+2529
-231
lines changed

DOCUMENTATION.md

Lines changed: 400 additions & 45 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Fujitsu PRIMERGY servers via iRMC.
2222
These modules and examples are intended to provide easy-to-follow and understandable solutions to manage
2323
Fujitsu PRIMERY server settings via iRMC.
2424

25-
##### Version: V1.1
25+
##### Version: V1.2
2626

2727
## Requirements
2828

2929
- Fujitsu PRIMERGY Server with iRMC S4 FW >= 9.04 or iRMC S5 FW >= 1.25
30-
- Ansible >= 2.1
30+
- Ansible >= 2.4
3131
- Python >= 2.6
32-
- Python module 'future'
32+
- Python modules 'future', 'requests', 'urllib3', 'requests_toolbelt'
3333

3434
## Getting started
3535

@@ -133,6 +133,7 @@ bare-metal-server provisioning tasks:
133133

134134
* V1.0: Initial version
135135
* V1.1: New: iRMC FW/BIOS update, BIOS boot order, iRMC profile management
136+
* V1.2: New: eLCM Offline/Online Update, RAID configuration
136137

137138
## License
138139

examples/compare_server_configuration_against_saved_profiles.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
# compare iRMC Profiles to file
5858
- name: Compare SystemConfig profile
59-
irmc_compare:
59+
irmc_compare_profiles:
6060
profile_path1: "{{ irmc_sysconfig_file }}"
6161
profile_json2: "{{ system_config.profile }}"
6262
register: system_config_result
@@ -67,7 +67,7 @@
6767
- "{{ system_config_result.comparison_list }}"
6868
when: system_config_result.comparison_result == false
6969
- name: Compare HWConfigurationIrmc profile
70-
irmc_compare:
70+
irmc_compare_profiles:
7171
profile_path1: "{{ irmc_hwconfig_file }}"
7272
profile_json2: "{{ hardware_config.profile }}"
7373
register: hardware_config_result
@@ -77,4 +77,3 @@
7777
- HWConfigurationIrmc profile differs from saved profile
7878
- "{{ hardware_config_result.comparison_list }}"
7979
when: hardware_config_result.comparison_result == false
80-
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
# FUJITSU LIMITED
3+
# Copyright 2018 FUJITSU LIMITED
4+
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)
5+
6+
# example playbook to get user data from iRMC and store
7+
# in a file in JSON format
8+
9+
# variables not defined in this playbook are expected to be provided
10+
# elsewhere, e.g. in group_vars/all
11+
12+
- name: Delete all arrays on controller and create new array
13+
connection: local
14+
hosts: iRMC_group
15+
16+
vars:
17+
# iRMC login credentials
18+
# irmc_user: "admin"
19+
# irmc_password: "admin"
20+
# Note: set validate_certificate to false for self-signed certificate
21+
# validate_certificate: false
22+
# adapter: 0
23+
# array_all: -1
24+
# level: 1
25+
# name: "TestRaid-1"
26+
27+
gather_facts: false
28+
29+
tasks:
30+
- name: Get current RAID configuration
31+
irmc_raid:
32+
irmc_url: "{{ inventory_hostname }}"
33+
irmc_username: "{{ irmc_user }}"
34+
irmc_password: "{{ irmc_password }}"
35+
validate_certs: "{{ validate_certificate }}"
36+
command: "get"
37+
register: raid
38+
delegate_to: localhost
39+
- name: Show current RAID configuration
40+
debug:
41+
msg: "{{ raid.configuration }}"
42+
43+
- name: Delete all RAID arrays on adapter
44+
irmc_raid:
45+
irmc_url: "{{ inventory_hostname }}"
46+
irmc_username: "{{ irmc_user }}"
47+
irmc_password: "{{ irmc_password }}"
48+
validate_certs: "{{ validate_certificate }}"
49+
command: "delete"
50+
adapter: "{{ adapter }}"
51+
array: "{{ array_all }}"
52+
delegate_to: localhost
53+
54+
- name: Create RAID array
55+
irmc_raid:
56+
irmc_url: "{{ inventory_hostname }}"
57+
irmc_username: "{{ irmc_user }}"
58+
irmc_password: "{{ irmc_password }}"
59+
validate_certs: "{{ validate_certificate }}"
60+
command: "create"
61+
adapter: "{{ adapter }}"
62+
level: "{{ level }}"
63+
name: "{{ name }}"
64+
delegate_to: localhost
65+
66+
- name: Get new RAID configuration
67+
irmc_raid:
68+
irmc_url: "{{ inventory_hostname }}"
69+
irmc_username: "{{ irmc_user }}"
70+
irmc_password: "{{ irmc_password }}"
71+
validate_certs: "{{ validate_certificate }}"
72+
command: "get"
73+
register: new
74+
delegate_to: localhost
75+
- name: Show new RAID configuration
76+
debug:
77+
msg: "{{ new.configuration }}"

examples/elcm_offline_update.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
# FUJITSU LIMITED
3+
# Copyright 2018 FUJITSU LIMITED
4+
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)
5+
6+
# example playbook to offline update a PRIMERGY server via eLCM
7+
8+
# variables not defined in this playbook are expected to be provided
9+
# elsewhere, e.g. in group_vars/all
10+
11+
# Notes:
12+
# - iRMC needs to be supplied with an eLCM License
13+
# - iRMC needs to be supplied with an eLCM SD-Card
14+
15+
- name: offline update a PRIMERGY server via eLCM
16+
connection: local
17+
hosts: iRMC_group
18+
19+
vars:
20+
# iRMC login credentials
21+
# irmc_user: "admin"
22+
# irmc_password: "admin"
23+
# Note: set validate_certificate to false for self-signed certificate
24+
# validate_certificate: false
25+
# elcm_server: "https://support.ts.fujitsu.com"
26+
# elcm_catalog: "DownloadManager/globalflash/GF_par_tree.exe"
27+
# elcm_use_proxy: false
28+
# elcm_proxy_url: "http://proxy.local"
29+
# elcm_proxy_port: "8080"
30+
# elcm_proxy_user: "user"
31+
# elcm_proxy_password: "password"
32+
# elcm_component: "PrimSupportPack-Win"
33+
# elcm_subcomponent: "FSC_SCAN"
34+
# elcm_skip_hcl_verify: true
35+
36+
gather_facts: false
37+
38+
tasks:
39+
- name: Get system power state
40+
irmc_powerstate:
41+
irmc_url: "{{ inventory_hostname }}"
42+
irmc_username: "{{ irmc_user }}"
43+
irmc_password: "{{ irmc_password }}"
44+
validate_certs: "{{ validate_certificate }}"
45+
command: "get"
46+
register: powerstate
47+
delegate_to: localhost
48+
49+
- name: Check that server is 'Off'
50+
fail:
51+
msg: "Cannot continue, server is 'On'"
52+
when: powerstate.power_state=="On"
53+
54+
- name: Configure eLCM Update Repository
55+
irmc_elcm_repository:
56+
irmc_url: "{{ inventory_hostname }}"
57+
irmc_username: "{{ irmc_user }}"
58+
irmc_password: "{{ irmc_password }}"
59+
validate_certs: "{{ validate_certificate }}"
60+
command: "set"
61+
server: "{{ elcm_server }}"
62+
catalog: "{{ elcm_catalog }}"
63+
use_proxy: "{{ elcm_use_proxy }}"
64+
proxy_url: "{{ elcm_proxy_url }}"
65+
proxy_port: "{{ elcm_proxy_port }}"
66+
proxy_user: "{{ elcm_proxy_user }}"
67+
proxy_password: "{{ elcm_proxy_password }}"
68+
delegate_to: localhost
69+
70+
- name: Prepare eLCM Offline Update
71+
irmc_elcm_offline_update:
72+
irmc_url: "{{ inventory_hostname }}"
73+
irmc_username: "{{ irmc_user }}"
74+
irmc_password: "{{ irmc_password }}"
75+
validate_certs: "{{ validate_certificate }}"
76+
command: "prepare"
77+
skip_hcl_verify: "{{ elcm_skip_hcl_verify }}"
78+
wait_for_finish: true
79+
delegate_to: localhost
80+
81+
- name: Execute eLCM Offline Update
82+
irmc_elcm_offline_update:
83+
irmc_url: "{{ inventory_hostname }}"
84+
irmc_username: "{{ irmc_user }}"
85+
irmc_password: "{{ irmc_password }}"
86+
validate_certs: "{{ validate_certificate }}"
87+
command: "execute"
88+
ignore_power_on: false
89+
wait_for_finish: true
90+
delegate_to: localhost

examples/elcm_online_update.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
# FUJITSU LIMITED
3+
# Copyright 2018 FUJITSU LIMITED
4+
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)
5+
6+
# example playbook to online update a PRIMERGY server via eLCM
7+
8+
# variables not defined in this playbook are expected to be provided
9+
# elsewhere, e.g. in group_vars/all
10+
11+
# Notes:
12+
# - iRMC needs to be supplied with an eLCM License
13+
# - iRMC needs to be supplied with an eLCM SD-Card
14+
15+
- name: online update a PRIMERGY server via eLCM
16+
connection: local
17+
hosts: iRMC_group
18+
19+
vars:
20+
# iRMC login credentials
21+
# irmc_user: "admin"
22+
# irmc_password: "admin"
23+
# Note: set validate_certificate to false for self-signed certificate
24+
# validate_certificate: false
25+
# elcm_server: "https://support.ts.fujitsu.com"
26+
# elcm_catalog: "DownloadManager/globalflash/GF_par_tree.exe"
27+
# elcm_use_proxy: false
28+
# elcm_proxy_url: "http://proxy.local"
29+
# elcm_proxy_port: "8080"
30+
# elcm_proxy_user: "user"
31+
# elcm_proxy_password: "password"
32+
# elcm_component: "PrimSupportPack-Win"
33+
# elcm_subcomponent: "FSC_SCAN"
34+
# elcm_skip_hcl_verify: true
35+
36+
gather_facts: false
37+
38+
tasks:
39+
- name: Get system power state
40+
irmc_powerstate:
41+
irmc_url: "{{ inventory_hostname }}"
42+
irmc_username: "{{ irmc_user }}"
43+
irmc_password: "{{ irmc_password }}"
44+
validate_certs: "{{ validate_certificate }}"
45+
command: "get"
46+
register: powerstate
47+
delegate_to: localhost
48+
49+
- name: Check that server is 'On'
50+
fail:
51+
msg: "Cannot continue, server is 'Off'"
52+
when: powerstate.power_state=="Off"
53+
54+
- name: Configure eLCM Update Repository
55+
irmc_elcm_repository:
56+
irmc_url: "{{ inventory_hostname }}"
57+
irmc_username: "{{ irmc_user }}"
58+
irmc_password: "{{ irmc_password }}"
59+
validate_certs: "{{ validate_certificate }}"
60+
command: "set"
61+
server: "{{ elcm_server }}"
62+
catalog: "{{ elcm_catalog }}"
63+
use_proxy: "{{ elcm_use_proxy }}"
64+
proxy_url: "{{ elcm_proxy_url }}"
65+
proxy_port: "{{ elcm_proxy_port }}"
66+
proxy_user: "{{ elcm_proxy_user }}"
67+
proxy_password: "{{ elcm_proxy_password }}"
68+
delegate_to: localhost
69+
70+
- name: Generate eLCM Online Update List
71+
irmc_elcm_online_update:
72+
irmc_url: "{{ inventory_hostname }}"
73+
irmc_username: "{{ irmc_user }}"
74+
irmc_password: "{{ irmc_password }}"
75+
validate_certs: "{{ validate_certificate }}"
76+
command: "check"
77+
skip_hcl_verify: "{{ elcm_skip_hcl_verify }}"
78+
wait_for_finish: true
79+
delegate_to: localhost
80+
81+
- name: Execute eLCM Online Update
82+
irmc_elcm_online_update:
83+
irmc_url: "{{ inventory_hostname }}"
84+
irmc_username: "{{ irmc_user }}"
85+
irmc_password: "{{ irmc_password }}"
86+
validate_certs: "{{ validate_certificate }}"
87+
command: "execute"
88+
wait_for_finish: true
89+
delegate_to: localhost
90+
91+
- name: Delete eLCM Online Update List
92+
irmc_elcm_online_update:
93+
irmc_url: "{{ inventory_hostname }}"
94+
irmc_username: "{{ irmc_user }}"
95+
irmc_password: "{{ irmc_password }}"
96+
validate_certs: "{{ validate_certificate }}"
97+
command: "delete"
98+
delegate_to: localhost

examples/export_server_configuration_profiles_to_files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
# Write iRMC Profiles to file
5959
- name: Write SystemConfig profile
6060
copy:
61-
content: "{{ system_config.ldap }}"
61+
content: "{{ system_config.profile }}"
6262
dest: "{{ irmc_sysconfig_file }}"
6363
- name: Write HWConfigurationIrmc profile
6464
copy:
65-
content: "{{ hardware_config.ldap }}"
65+
content: "{{ hardware_config.profile }}"
6666
dest: "{{ irmc_hwconfig_file }}"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
# FUJITSU LIMITED
3+
# Copyright 2018 FUJITSU LIMITED
4+
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)
5+
6+
# example playbook for module 'irmc_elcm_offline_update'
7+
# to offline update a server via iRMC
8+
9+
# variables not defined in this playbook are expected to be provided
10+
# elsewhere, e.g. in group_vars/all
11+
12+
- name: irmc_elcm_offline_update - usage examples
13+
connection: local
14+
hosts: iRMC_group
15+
16+
vars:
17+
# iRMC login credentials
18+
# irmc_user: "admin"
19+
# irmc_password: "admin"
20+
# Note: set validate_certificate to false for self-signed certificate
21+
# validate_certificate: false
22+
23+
gather_facts: false
24+
25+
tasks:
26+
# Prepare eLCM Offline Update
27+
- name: Prepare eLCM Offline Update
28+
irmc_elcm_offline_update:
29+
irmc_url: "{{ inventory_hostname }}"
30+
irmc_username: "{{ irmc_user }}"
31+
irmc_password: "{{ irmc_password }}"
32+
validate_certs: "{{ validate_certificate }}"
33+
command: "prepare"
34+
skip_hcl_verify: "{{ elcm_skip_hcl_verify }}"
35+
ignore_power_on: false
36+
delegate_to: localhost
37+
38+
# Execute eLCM Offline Update
39+
- name: Execute eLCM Offline Update
40+
irmc_elcm_offline_update:
41+
irmc_url: "{{ inventory_hostname }}"
42+
irmc_username: "{{ irmc_user }}"
43+
irmc_password: "{{ irmc_password }}"
44+
validate_certs: "{{ validate_certificate }}"
45+
command: "execute"
46+
ignore_power_on: false
47+
wait_for_finish: true

0 commit comments

Comments
 (0)