Skip to content

Ansible

Documentation and Resources

Galaxy Collections I Care About

IBM Storage

Brocade

Ansible collections stored here: /root/.ansible/collections/ansible_collections/ibm/storage_virtualize

Implementation

Install Python

dnf install python3.9 -y  

Install Ansible

python3 -m pip install --user ansible  

Getting Started

Sample Ansible Setup

mkdir /etc/ansible
mkdir /etc/ansible/playbooks

You can run ansible modules directly with the command: ansible You can run an ansible playbook using the command: ansible-playbook

Hello World! Playbook Example

  1. Create the emply playbook file

    cd /etc/ansible/playbooks
    vi helloworld.yml
    
  2. Enter the following contents in the playbook YAML file

    ---
    - name: My second playbook
    hosts: localhost
    
    tasks:
    - name: Print Hello World!
        debug: msg="Hello World!"
    
  3. Run the playbook

    ansible-playbook helloworld.yml