Standard

Project link

schema

Usage

dux -t <tasklist.yaml> -l <hostlist.yaml> -k <SSH private key> -u <username>

with tasklist.yaml

- name: Let's install a web server !
  steps:
    - name: First, we test the connectivity and authentication with the host.
      ping:
      
    - name: Then we can install the package...
      with_sudo: true
      apt:
        package: '{{ package_name }}'
        state: present
        
    - name: ... and start & enable the service.
      with_sudo: true
      service:
        name: '{{ service_name }}'
        state: started
        enabled: true

and hostlist.yaml

vars:
  package_name: apache2
  service_name: apache2

hosts:
  - 10.20.0.203
  - 10.20.0.204

Output example

{
  "jobs": [
    {
      "host": "10.20.0.203",
      "timestamp_start": "2024-11-07T22:53:52.781400539+00:00",
      "timestamp_end": "2024-11-07T22:54:06.610757092+00:00",
      "final_status": "ApplySuccesful",
      "tasks": [
        {
          "name": "Let's install a web server !",
          "steps": [
            {
              "name": "First, we test the connectivity and authentication with the host.",
              "expected_state": {
                "ping": {}
              },
              "status": "ApplySuccessful"
            },
            {
              "name": "Then we can install the package...",
              "expected_state": {
                "apt": {
                  "state": "present",
                  "package": "apache2"
                }
              },
              "status": "ApplySuccessful"
            },
            {
              "name": "... and start & enable the service.",
              "expected_state": {
                "service": {
                  "name": "apache2",
                  "state": "started",
                  "enabled": true
                }
              },
              "status": "ApplySuccessful"
            }
          ]
        }
      ]
    },
    {
      "host": "10.20.0.204",
      "timestamp_start": "2024-11-07T22:53:52.742561538+00:00",
      "timestamp_end": "2024-11-07T22:54:04.799505739+00:00",
      "final_status": "ApplySuccesful",
      "tasks": [
        {
          "name": "Let's install a web server !",
          "steps": [
            {
              "name": "First, we test the connectivity and authentication with the host.",
              "expected_state": {
                "ping": {}
              },
              "status": "ApplySuccessful"
            },
            {
              "name": "Then we can install the package...",
              "expected_state": {
                "apt": {
                  "state": "present",
                  "package": "apache2"
                }
              },
              "status": "ApplySuccessful"
            },
            {
              "name": "... and start & enable the service.",
              "expected_state": {
                "service": {
                  "name": "apache2",
                  "state": "started",
                  "enabled": true
                }
              },
              "status": "ApplySuccessful"
            }
          ]
        }
      ]
    }
  ]
}