Skip to content

Commit

Permalink
Ansible Integration V1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
akumch committed Dec 14, 2018
1 parent b1d3878 commit 8edea56
Show file tree
Hide file tree
Showing 44 changed files with 2,529 additions and 231 deletions.
445 changes: 400 additions & 45 deletions DOCUMENTATION.md

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Fujitsu PRIMERGY servers via iRMC.
These modules and examples are intended to provide easy-to-follow and understandable solutions to manage
Fujitsu PRIMERY server settings via iRMC.

##### Version: V1.1
##### Version: V1.2

## Requirements

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

## Getting started

Expand Down Expand Up @@ -133,6 +133,7 @@ bare-metal-server provisioning tasks:

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

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

# compare iRMC Profiles to file
- name: Compare SystemConfig profile
irmc_compare:
irmc_compare_profiles:
profile_path1: "{{ irmc_sysconfig_file }}"
profile_json2: "{{ system_config.profile }}"
register: system_config_result
Expand All @@ -67,7 +67,7 @@
- "{{ system_config_result.comparison_list }}"
when: system_config_result.comparison_result == false
- name: Compare HWConfigurationIrmc profile
irmc_compare:
irmc_compare_profiles:
profile_path1: "{{ irmc_hwconfig_file }}"
profile_json2: "{{ hardware_config.profile }}"
register: hardware_config_result
Expand All @@ -77,4 +77,3 @@
- HWConfigurationIrmc profile differs from saved profile
- "{{ hardware_config_result.comparison_list }}"
when: hardware_config_result.comparison_result == false

77 changes: 77 additions & 0 deletions examples/delete_all_arrays_and_create_new_array.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
# FUJITSU LIMITED
# Copyright 2018 FUJITSU LIMITED
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)

# example playbook to get user data from iRMC and store
# in a file in JSON format

# variables not defined in this playbook are expected to be provided
# elsewhere, e.g. in group_vars/all

- name: Delete all arrays on controller and create new array
connection: local
hosts: iRMC_group

vars:
# iRMC login credentials
# irmc_user: "admin"
# irmc_password: "admin"
# Note: set validate_certificate to false for self-signed certificate
# validate_certificate: false
# adapter: 0
# array_all: -1
# level: 1
# name: "TestRaid-1"

gather_facts: false

tasks:
- name: Get current RAID configuration
irmc_raid:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "get"
register: raid
delegate_to: localhost
- name: Show current RAID configuration
debug:
msg: "{{ raid.configuration }}"

- name: Delete all RAID arrays on adapter
irmc_raid:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "delete"
adapter: "{{ adapter }}"
array: "{{ array_all }}"
delegate_to: localhost

- name: Create RAID array
irmc_raid:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "create"
adapter: "{{ adapter }}"
level: "{{ level }}"
name: "{{ name }}"
delegate_to: localhost

- name: Get new RAID configuration
irmc_raid:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "get"
register: new
delegate_to: localhost
- name: Show new RAID configuration
debug:
msg: "{{ new.configuration }}"
90 changes: 90 additions & 0 deletions examples/elcm_offline_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
# FUJITSU LIMITED
# Copyright 2018 FUJITSU LIMITED
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)

# example playbook to offline update a PRIMERGY server via eLCM

# variables not defined in this playbook are expected to be provided
# elsewhere, e.g. in group_vars/all

# Notes:
# - iRMC needs to be supplied with an eLCM License
# - iRMC needs to be supplied with an eLCM SD-Card

- name: offline update a PRIMERGY server via eLCM
connection: local
hosts: iRMC_group

vars:
# iRMC login credentials
# irmc_user: "admin"
# irmc_password: "admin"
# Note: set validate_certificate to false for self-signed certificate
# validate_certificate: false
# elcm_server: "https://support.ts.fujitsu.com"
# elcm_catalog: "DownloadManager/globalflash/GF_par_tree.exe"
# elcm_use_proxy: false
# elcm_proxy_url: "http://proxy.local"
# elcm_proxy_port: "8080"
# elcm_proxy_user: "user"
# elcm_proxy_password: "password"
# elcm_component: "PrimSupportPack-Win"
# elcm_subcomponent: "FSC_SCAN"
# elcm_skip_hcl_verify: true

gather_facts: false

tasks:
- name: Get system power state
irmc_powerstate:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "get"
register: powerstate
delegate_to: localhost

- name: Check that server is 'Off'
fail:
msg: "Cannot continue, server is 'On'"
when: powerstate.power_state=="On"

- name: Configure eLCM Update Repository
irmc_elcm_repository:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "set"
server: "{{ elcm_server }}"
catalog: "{{ elcm_catalog }}"
use_proxy: "{{ elcm_use_proxy }}"
proxy_url: "{{ elcm_proxy_url }}"
proxy_port: "{{ elcm_proxy_port }}"
proxy_user: "{{ elcm_proxy_user }}"
proxy_password: "{{ elcm_proxy_password }}"
delegate_to: localhost

- name: Prepare eLCM Offline Update
irmc_elcm_offline_update:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "prepare"
skip_hcl_verify: "{{ elcm_skip_hcl_verify }}"
wait_for_finish: true
delegate_to: localhost

- name: Execute eLCM Offline Update
irmc_elcm_offline_update:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "execute"
ignore_power_on: false
wait_for_finish: true
delegate_to: localhost
98 changes: 98 additions & 0 deletions examples/elcm_online_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
# FUJITSU LIMITED
# Copyright 2018 FUJITSU LIMITED
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)

# example playbook to online update a PRIMERGY server via eLCM

# variables not defined in this playbook are expected to be provided
# elsewhere, e.g. in group_vars/all

# Notes:
# - iRMC needs to be supplied with an eLCM License
# - iRMC needs to be supplied with an eLCM SD-Card

- name: online update a PRIMERGY server via eLCM
connection: local
hosts: iRMC_group

vars:
# iRMC login credentials
# irmc_user: "admin"
# irmc_password: "admin"
# Note: set validate_certificate to false for self-signed certificate
# validate_certificate: false
# elcm_server: "https://support.ts.fujitsu.com"
# elcm_catalog: "DownloadManager/globalflash/GF_par_tree.exe"
# elcm_use_proxy: false
# elcm_proxy_url: "http://proxy.local"
# elcm_proxy_port: "8080"
# elcm_proxy_user: "user"
# elcm_proxy_password: "password"
# elcm_component: "PrimSupportPack-Win"
# elcm_subcomponent: "FSC_SCAN"
# elcm_skip_hcl_verify: true

gather_facts: false

tasks:
- name: Get system power state
irmc_powerstate:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "get"
register: powerstate
delegate_to: localhost

- name: Check that server is 'On'
fail:
msg: "Cannot continue, server is 'Off'"
when: powerstate.power_state=="Off"

- name: Configure eLCM Update Repository
irmc_elcm_repository:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "set"
server: "{{ elcm_server }}"
catalog: "{{ elcm_catalog }}"
use_proxy: "{{ elcm_use_proxy }}"
proxy_url: "{{ elcm_proxy_url }}"
proxy_port: "{{ elcm_proxy_port }}"
proxy_user: "{{ elcm_proxy_user }}"
proxy_password: "{{ elcm_proxy_password }}"
delegate_to: localhost

- name: Generate eLCM Online Update List
irmc_elcm_online_update:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "check"
skip_hcl_verify: "{{ elcm_skip_hcl_verify }}"
wait_for_finish: true
delegate_to: localhost

- name: Execute eLCM Online Update
irmc_elcm_online_update:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "execute"
wait_for_finish: true
delegate_to: localhost

- name: Delete eLCM Online Update List
irmc_elcm_online_update:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "delete"
delegate_to: localhost
4 changes: 2 additions & 2 deletions examples/export_server_configuration_profiles_to_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
# Write iRMC Profiles to file
- name: Write SystemConfig profile
copy:
content: "{{ system_config.ldap }}"
content: "{{ system_config.profile }}"
dest: "{{ irmc_sysconfig_file }}"
- name: Write HWConfigurationIrmc profile
copy:
content: "{{ hardware_config.ldap }}"
content: "{{ hardware_config.profile }}"
dest: "{{ irmc_hwconfig_file }}"
47 changes: 47 additions & 0 deletions examples/irmc_elcm_offline_update_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# FUJITSU LIMITED
# Copyright 2018 FUJITSU LIMITED
# GNU General Public License v3.0+ (see [LICENSE.md](LICENSE.md) or https://www.gnu.org/licenses/gpl-3.0.txt)

# example playbook for module 'irmc_elcm_offline_update'
# to offline update a server via iRMC

# variables not defined in this playbook are expected to be provided
# elsewhere, e.g. in group_vars/all

- name: irmc_elcm_offline_update - usage examples
connection: local
hosts: iRMC_group

vars:
# iRMC login credentials
# irmc_user: "admin"
# irmc_password: "admin"
# Note: set validate_certificate to false for self-signed certificate
# validate_certificate: false

gather_facts: false

tasks:
# Prepare eLCM Offline Update
- name: Prepare eLCM Offline Update
irmc_elcm_offline_update:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "prepare"
skip_hcl_verify: "{{ elcm_skip_hcl_verify }}"
ignore_power_on: false
delegate_to: localhost

# Execute eLCM Offline Update
- name: Execute eLCM Offline Update
irmc_elcm_offline_update:
irmc_url: "{{ inventory_hostname }}"
irmc_username: "{{ irmc_user }}"
irmc_password: "{{ irmc_password }}"
validate_certs: "{{ validate_certificate }}"
command: "execute"
ignore_power_on: false
wait_for_finish: true

0 comments on commit 8edea56

Please sign in to comment.