Note: This document may not display properly when viewed on https://galaxy.ansible.com/. Therefore, it is recommended to view it on github.com.
This document is a guide for users of Ansible collection fujitsu.primergy
.
Ansible collections are packages that bundle Ansible playbooks, modules, roles, plugins, documentation, and more.
Ansible collection fujitsu.primergy
aims to automate configuration tasks
based on PRIMERGY's "Environment and setting sheet" and provides Ansible roles and modules.
This user guide provides information on setting up the Ansible collection, usage examples of roles, and troubleshooting.
This document is intended for users with basic knowledge of Ansible.
- Linux (For Windows, refer to "5. Frequently Asked Questions (FAQ)" under "Can I run Ansible on Windows?)"
- Python 3.10
ansible
>= 8.0.0pywinrm
>= 0.5.0requests
>= 2.32.0requests_toolbelt
>= 1.0.0urllib3
>= 2.2.0
Create and activate a Python virtual environment (venv), then install the necessary Python modules including Ansible:
$ mkdir -p ~/ansible/primergy && cd $_ # Create and move to a directory of your choice
$ python -m venv venv && . $_/bin/activate
(venv) $ python -m pip install ansible pywinrm requests requests_toolbelt urllib3
Use Ansible installed in the virtual environment (venv)
to install the Ansible collection fujitsu.primergy
from https://galaxy.ansible.com/:
(venv) $ ansible-galaxy collection install fujitsu.primergy
In Ansible, managed devices are defined in an "inventory file".
- Define two groups:
[iRMC_group]
and[windows]
. These group names align with the examples of how to execute Ansible playbooks explained in this "User Guide" and "Configuration Guide". - In
[iRMC_group]
, specify the IP address of PRIMERGY's remote management interface, an account with administrative privileges (if in shipped condition,admin
is available), and its password. - In
[windows]
, specify the IP address of the Windows server, an account with administrative privileges (usuallyAdministrator
), and its password. - Both groups can list multiple devices/servers.
- In
[*:vars]
, you can specify common parameters for each group. Here, connection setting parameters are specified.
Name the file inventory.ini
and include the following content:
[iRMC_group]
<ipaddress-of-iRMC-device> irmc_user=admin irmc_password=<password>
[windows]
<ipaddress-of-windows> ansible_user=Administrator ansible_password=<password>
[iRMC_group:vars]
validate_certificate=false # Necessary if SSL server certificates are not registered on iRMC devices
[windows:vars]
ansible_port=5985
ansible_connection=winrm
ansible_winrm_transport=ntlm
ansible_winrm_server_cert_validation=ignore
Retrieve and display the configuration and settings of the specified iRMC device:
$ ansible localhost -m fujitsu.primergy.irmc_facts -a "irmc_url=192.0.2.1 irmc_username=admin irmc_password=P@ssw0rd! validate_certs=false"
localhost | SUCCESS => {
"changed": false,
"facts": {
"hardware": {
"ethernetinterfaces": {
...
}
}
}
}
irmc_url
, irmc_username
, and irmc_password
correspond to the entries described
in the [iRMC_group]
group in the inventory file.
Verify the connection to the [windows]
group specified in the inventory file:
$ ansible -i inventory.ini windows -m ansible.windows.win_ping
192.0.2.2 | SUCCESS => {
"changed": false,
"ping": "pong"
}
If multiple servers are listed in [windows]
, connection verification is performed for all servers.
Ensure that the specified Windows server can receive requests to WinRM.
It is assumed that WinRM connections over HTTP are enabled immediately after installing the Windows server
(can be verified via PowerShell with "winrm enumerate winrm/config/Listener"
).
If the connectivity test fails, apply the following firewall settings:
New-NetFirewallRule -Name "WinRM HTTP" -DisplayName "Allow WinRM over HTTP" -Enabled True -Direction Inbound -Protocol TCP -LocalPort 5985 -Action Allow
For a detailed list of modules and roles in this collection, refer to the Ansible Galaxy Collection Page.
Refer to the Configuration Guide (link to galaxy.ansible.com).
Sample playbooks are provided in examples/playbooks/
.
For usage information, Refer to the Sample Playbook Documentation (link to galaxy.ansible.com).
To check the details of errors that occurred during playbook execution,
use the -vvv
option to obtain debug logs and examine error messages and variable values.
ansible-playbook -i inventory.ini playbook.yml -vvv
We welcome feedback and contributions to this project.
Bug reports, feature requests, and improvement suggestions can be sent to the following contacts.
We will respond in Japanese or English.
(For internal use, etc.) For private contacts or inquiries, please send an email to the following addresses:
- Shinya Hamano (<hamano.shinya@fujitsu.com>)
- Yutaka Kamioka (<yutaka.kamioka@fujitsu.com>)
- Jiajun Guo (<guo.jiajun@fujitsu.com>)
- Tomohisa Nakai (<nakai.tomohisa@fujitsu.com>)
Members and email addresses are current as of December 2024.
For public feedback or contribution proposals, please use the GitHub "Issues" page.
GitHub Issues: https://github.com/fujitsu/fujitsu-ansible-irmc-integration/issues
When reporting bugs, including the following information will facilitate smooth handling.
- Purpose and Operations Performed: Describe the purpose of the setting and the specific operations/settings performed to achieve it.
- Occurrence Details: Describe specifically what actually happened, such as execution results or unexpected behaviors.
- Steps or Situation to Reproduce: Describe the steps required to reproduce the problem, and the environment or situation when it occurred.
- Usage Environment (Equipment and Versions, etc.):
Describe the model name of the equipment used, and BIOS or iRMC versions (if the target is iRMC devices).
Obtainingirmc_facts
using the method described in the section "Connectivity Test to iRMC Devices" of this document is also a good method. - Ansible Execution Log: Including the Ansible execution log will help identify the cause.
Particularly, having detailed logs using the
-vvv
option makes analysis easier.
It is not supported on Windows.
Ansible can be run on Windows Subsystem for Linux (WSL),
but it is not officially supported and is not recommended for use in production systems.
For details, refer to this URL:
https://docs.ansible.com/ansible/latest/os_guide/intro_windows.html#using-windows-as-the-control-node
- https://docs.ansible.com/users.html
- Start writing Ansible playbooks - https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html#playbook-syntax
- Build inventory files to manage multiple hosts - https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html
- Start exploring Ansible Galaxy - https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#finding-collections-on-galaxy