Skip to content

redhat-gpte-devopsautomation/zt-writing-your-first-playbook

Repository files navigation

zt-writing-your-first-playbook

Understanding Directory Structure

  1. Content Directory

    tree output
    .
    ├── README.adoc                 # Readme file
    ├── content                     # Content directory
    ├── runtime-automation          # Playbook directory
    ├── zero-touch-config.yml       # Configuration file
    └── zero-touch-site.yml
  2. Content Directory

    tree output
    content/modules/ROOT/
    ├── assets
    │   └── images                                  # Images used in your content
    │       ├── collasped.png
    │       ├── end.png
    │       ├── idem-output.png
    │       ├── navigator-output.png
    │       ├── next.png
    │       ├── solve.png
    │       ├── tabs.png
    │       └── vscode_inventory.png
    └── pages                                       # Your content goes here
        ├── 01-playbook-inventory.adoc              # First page of your lab
        ├── 02-playbook-directory-structure.adoc
        ├── 03-playbook-run-it.adoc
        ├── 04-playbook-multi-node.adoc
        ├── 05-playbook-variables.adoc
        ├── 06-playbook-conditionals.adoc
        ├── 07-handlers.adoc
        ├── 08-playbook-loops.adoc
        ├── 09-playbook-templates.adoc
        └── 10-roles.adoc
  3. Module Playbook Directory Structure

    tree output
    runtime-automation/
    ├── 01-playbook-inventory               # The directory name should be the same as# the module content page name
    │   ├── setup.yml                       # Setup playbook which run at start of module# and when clicked on next button
    │   ├── solve.yml                       # Solve playbook, run when clicked on solve button
    │   └── validation.yml                  # Validation playbook, run when click on next button
    ├── 02-playbook-directory-structure
    │   ├── setup.yml
    │   ├── solve.yml
    │   └── validation.yml
    │
    ├── # --- output Omitted ---
    │
    ├── 10-roles
    │   ├── setup.yml
    │   ├── solve.yml
    │   └── validation.yml
    ├── ansible.cfg                         # Ansible configuration used with module playbooks
    └── inventory                           # Inventory for the playbook

Understanding Zero Touch Configration file

  1. The zero-touch-config.yml configuration file

    tree output
    ---
    antora:
      name: modules
      dir: www
      modules:
        - name: 01-playbook-inventory               # Module Name
          label: Playbook Inventory                 # Module Label
          solveButton: true                         # Enable Solve button
        - name: 02-playbook-directory-structure
          label: Playbook Directory Structure
          solveButton: true
    
        # --- output Omitted ---
    
        - name: 10-roles
          label: Roles
          solveButton: true
    
    tabs:
      - name: VSCode Editor                         # Tab name
        port: 8443                                  # Port no of the service
        path: /?folder=/home/rhel/ansible-files/    # Path suffix
      - name: ">_control"
        port: 443
        path: /tty1
    Note
    Keep the rest of directories and files as default.
Important
This stucture works well with agnosticd role showroom .

About

Zero Touch Writing your first playbook lab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published