Ansible is a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy.
IBM i systems can be managed nodes of Ansible. This project is to enrich IBM i support on Ansible, like providing more IBM i modules and examples to manage IBM i nodes.
Getting Started Articles:
You may want to check out below articles first if you are new to Ansible for IBM i support.
https://developer.ibm.com/linuxonpower/2020/05/01/ansible-automation-for-ibm-power-systems/
https://ibm.github.io/cloud-i-blog/
Dependencies on IBM i node:
- 5733SC1 Base and Option 1
- 5770DG1
- Python
- python itoolkit
- python ibm_db
Note: 1) Use yum to install 3, 4, 5. About how to install yum on IBM i, refer to examples/ibmi/playbooks/ibmi-install-yum.yml. 2) Both python 2 and python 3 are supported. The python which is used by Ansible depends on value of ansible_python_interpreter in the inventory file. For example, ansible_python_interpreter = "/QOpensys/pkgs/bin/python2" or ansible_python_interpreter = "/QOpensys/pkgs/bin/python3"
How to enable ansible server and IBM i nodes?
- Install ansible server. For example, run "yum install ansible" on a supported platform.
- Clone this repository to your Ansible server.
- Create your inventory file under examples/ibmi, an example can be found here "examples/ibmi/hosts_ibmi.ini"
- Run "ansible-playbook -i examples/ibmi/your_inventory_file examples/ibmi/playbooks/enable-ansible-for-i/setup.yml"
Manage IBM i nodes by Ansible Tower?
- Create your repository to fork this repository.
- Create your playbook in the root directory, for example, the same directory of ibmi-try-tower-structure.yml
- Create Project in Ansible Tower to point to your repository.
- Create job template to run your own playbook
Note, you can create new pull request to merge the changes in this repository into yours.
Directory structure:
├── action_plugins - Only applicable to Ansible tower. In where copies of lib/ansible/plugins/action/ are kept.
├── examples - Ansible playbook examples.
├── lib - Source code of IBM i new modules and plugins. Copy the folder to the module path on ansible server.
├── library - Only applicable to Ansible tower. In where copies of lib/ansible/modules/ibmi/ are kept.
├── module_utils - Only applicable to Ansible tower. In where copies of lib/ansible/module_utils/ are kept.
├── test - Integration test code of IBM i new modules and plugins.
├── ibmi_try_tower_structure.yml. Only applicable to Ansible tower.
IBM i Module Index:
ibmi_at | Schedule a batch job on a remote IBMi node. |
ibmi_cl_command | Executes a CL command. |
ibmi_copy | Copy a save file from local to a remote IBMi node. |
ibmi_display_subsystem | Display all currently active subsystems or currently active jobs in a subsystem. |
ibmi_end_subsystem | End a subsystem. |
ibmi_fetch |
Fetch objects or a library from a remote IBMi node and store on local. |
ibmi_install_product_from_savf |
Install the the licensed program(product) from a save file. |
ibmi_lib_restore |
Restore one library on a remote IBMi node. |
ibmi_lib_save |
Save one libary on a remote IBMi node. |
ibmi_object_authority |
Grant, Revoke and Display the Object Authority. |
ibmi_object_restore |
Restore one or more objects on a remote IBMi node. |
ibmi_object_save |
Save one or more objects on a remote IBMi node. |
ibmi_reboot |
Reboot IBMi machine. |
ibmi_save_product_to_savf |
Save the the licensed program(product) to a save file. |
ibmi_script |
Execute a local cl/sql script file on a remote ibm i node. |
ibmi_script_execute |
Execute a cl/sql script file on a remote ibm i node. |
ibmi_sql_execute |
Executes a SQL non-DQL(Data Query Language) statement. |
ibmi_sql_query |
Executes a SQL DQL(Data Query Language) statement. |
ibmi_start_subsystem |
Start a subsystem. |
ibmi_sync |
Synchronize a save file from current ibm i node A to another ibm i node B. |
ibmi_synchronize |
Synchronize a save file from ibm i node A to another ibm i node B. |
ibmi_uninstall_product |
Delete the objects that make up the licensed program(product). |
ibmi_user_and_group |
Create, Change and Display a user(or group) profile. |
ibmi_device_vary |
Vary on or off target device on a remote IBMi node |
ibmi_host_server_service |
Manage host server on a remote IBMi node |
ibmi_tcp_server_service |
Manage tcp server on a remote IBMi node |
ibmi_iasp |
Control IASP on target IBMi node |
ibmi_message |
Search message on a remote IBMi node |
ibmi_fix |
Load from save file, apply, remove or query PTF(s). |
ibmi_fix_imgclg |
Install fixes from virtual image. |
ibmi_job |
Returns job information per user request. |
ibmi_object_find |
Find specific IBM i object(s). |
ibmi_submit_job |
Submit an IBM i job. |
ibmi_tcp_interface |
Manage IBM i tcp interface. You can add, remove, start, end or query a tcp interface. |
License:
GNU General Public License v3.0 or later.