# SPDX-License-Identifier: MIT
---
- name: Create all kinds of resources in a cluster
  hosts: all
  gather_facts: true  # needs facts
  vars_files: vars/main.yml
  vars:
    ha_cluster_cluster_name: test-cluster
    # Make cluster not try starting any resources. Due to missing resource
    # daemons, container services and images, the cluster would get stuck
    # otherwise.
    ha_cluster_cluster_properties:
      - attrs:
          - name: maintenance-mode
            value: "true"
          - name: stonith-enabled
            value: "false"
          - name: stop-all-resources
            value: "true"
    ha_cluster_resource_primitives:
      - id: fence-no-attrs
        agent: 'stonith:fence_kdump'
      - id: fence-empty-attrs1
        agent: 'stonith:fence_kdump'
        instance_attrs:
        meta_attrs:
        operations:
      - id: fence-empty-attrs2
        agent: 'stonith:fence_kdump'
        instance_attrs:
          - attrs:
        meta_attrs:
          - attrs:
        copy_operations_from_agent: false  # this should be ignored for stonith
        # Pcs requires action and at least one option to be defined for an
        # operation. Therefore, there are no tests for partially defined
        # operations.
      - id: fence-with-attrs
        agent: 'stonith:fence_kdump'
        instance_attrs:
          - attrs:
              - name: pcmk_host_list
                value: node1 node2
              - name: timeout
                value: 30
        meta_attrs:
          - attrs:
              - name: target-role
                value: Stopped
              - name: an-attr
                value: a value
        operations:
          - action: monitor
            attrs:
              - name: timeout
                value: 13
              - name: interval
                value: 26
          - action: monitor
            attrs:
              - name: timeout
                value: '14s'
              - name: interval
                value: '28s'

      - id: test-no-attrs
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-empty-attrs1
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
        instance_attrs:
        meta_attrs:
        operations:
      - id: test-empty-attrs2
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
        instance_attrs:
          - attrs:
        meta_attrs:
          - attrs:
          # Pcs requires action and at least one option to be defined for an
          # operation. Therefore, there are no tests for partially defined
          # operations.
      - id: test-with-attrs1
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
        instance_attrs:
          - attrs:
              - name: fake
                value: fake value
        meta_attrs:
          - attrs:
              - name: target-role
                value: Stopped
        operations:
          - action: monitor
            attrs:
              - name: timeout
                value: '1min'
      - id: test-with-attrs2
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
        instance_attrs:
          - attrs:
              - name: fake
                value: fake value
              - name: passwd
                value: passwd value1
        meta_attrs:
          - attrs:
              - name: target-role
                value: Stopped
              - name: an-attr
                value: a value
        operations:
          - action: monitor
            attrs:
              - name: timeout
                value: 13
              - name: interval
                value: 26
          - action: monitor
            attrs:
              - name: timeout
                value: 14
              - name: interval
                value: 28
      - id: test-no-default-ops
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
        copy_operations_from_agent: false

      - id: test-1a
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-1b
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-2a
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-3a
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-4a
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'

      - id: test-clone-no-options
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: stateful-clone-promotable
        agent: 'ocf:pacemaker:Stateful'
      - id: test-clone-id
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-clone-empty-attrs1
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-clone-empty-attrs2
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: test-clone-with-attrs1
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'
      - id: stateful-clone-with-attrs2
        agent: 'ocf:pacemaker:Stateful'

      - id: test-bundle
        # wokeignore:rule=dummy
        agent: 'ocf:pacemaker:Dummy'

    ha_cluster_resource_groups:
      - id: group1
        resource_ids:
          - test-1a
          - test-1b
      - id: group2
        resource_ids:
          - test-2a
        meta_attrs:
      - id: group3
        resource_ids:
          - test-3a
        meta_attrs:
          - attrs:
      - id: group4
        resource_ids:
          - test-4a
        meta_attrs:
          - attrs:
              - name: target-role
                value: Stopped
              - name: an-attr
                value: a value

    ha_cluster_resource_clones:
      - resource_id: test-clone-no-options
      - resource_id: stateful-clone-promotable
        promotable: true
      - resource_id: test-clone-id
        id: custom-clone-id1
      - resource_id: test-clone-empty-attrs1
        meta_attrs:
      - resource_id: test-clone-empty-attrs2
        meta_attrs:
          - attrs:
      - resource_id: test-clone-with-attrs1
        meta_attrs:
          - attrs:
              - name: target-role
                value: Stopped
      - resource_id: stateful-clone-with-attrs2
        promotable: true
        id: custom-clone-id2
        meta_attrs:
          - attrs:
              - name: target-role
                value: Stopped
              - name: an-attr
                value: a value
      - resource_id: group3

    ha_cluster_resource_bundles:
      - id: bundle-minimal
        container:
          type: docker
          options:
            - name: image
              value: my:image1
      - id: bundle-minimal-with-resource
        resource_id: test-bundle
        container:
          type: docker
          options:
            - name: image
              value: my:image1
        network_options:
          - name: control-port
            value: 3121
      - id: bundle-all-options
        container:
          type: docker
          options:
            - name: image
              value: my:image1
            - name: replicas
              value: 2
        network_options:
          - name: control-port
            value: 3121
          - name: host-netmask
            value: 32
        port_map:
          -
            - name: port  # yamllint disable-line rule:hyphens
              value: 23456
          -
            - name: port  # yamllint disable-line rule:hyphens
              value: 34567
            - name: internal-port
              value: 45678
        storage_map:
          -
            - name: source-dir  # yamllint disable-line rule:hyphens
              value: /tmp/source1
            - name: target-dir
              value: /tmp/target1
          -
            - name: source-dir  # yamllint disable-line rule:hyphens
              value: /tmp/source2
            - name: target-dir
              value: /tmp/target2
        meta_attrs:
          - attrs:
              - name: target-role
                value: Stopped
              - name: an-attr
                value: a value

  tasks:
    - name: Run test
      tags:
        - tests::booted
        - tests::verify
      block:
        - name: Skip test in bootc mode
          include_tasks: tasks/skip_if_bootc.yml

        - name: Set up test environment
          include_role:
            name: linux-system-roles.ha_cluster
            tasks_from: test_setup.yml

        - name: Run HA Cluster role
          include_role:
            name: linux-system-roles.ha_cluster
            public: true

        - name: Fetch cluster versions of cluster components
          include_tasks: tasks/fetch_versions.yml

        # yamllint disable rule:line-length
        - name: Verify stonith configuration
          when:
            - '"pcmk.resource.config.output-formats" not in __test_pcs_capabilities'
          vars:
            __test_expected_lines:
              - ' Resource: fence-no-attrs (class=stonith type=fence_kdump)'
              - '  Operations: monitor interval=60s (fence-no-attrs-monitor-interval-60s)'
              - ' Resource: fence-empty-attrs1 (class=stonith type=fence_kdump)'
              - '  Operations: monitor interval=60s (fence-empty-attrs1-monitor-interval-60s)'
              - ' Resource: fence-empty-attrs2 (class=stonith type=fence_kdump)'
              - '  Operations: monitor interval=60s (fence-empty-attrs2-monitor-interval-60s)'
              - ' Resource: fence-with-attrs (class=stonith type=fence_kdump)'
              - '  Attributes: pcmk_host_list="node1 node2" timeout=30'
              - '  Meta Attrs: an-attr="a value" target-role=Stopped'
              - '  Operations: monitor interval=26 timeout=13 (fence-with-attrs-monitor-interval-26)'
              - '              monitor interval=28s timeout=14s (fence-with-attrs-monitor-interval-28s)'
          block:
            - name: Fetch stonith configuration from the cluster
              command:
                cmd: pcs stonith config
              register: __test_pcs_stonith_config
              changed_when: false

            - name: Print real stonith configuration
              debug:
                var: __test_pcs_stonith_config.stdout_lines

            - name: Print expected stonith configuration
              debug:
                var: __test_expected_lines | select | list

            - name: Check stonith configuration
              assert:
                that:
                  - __test_pcs_stonith_config.stdout_lines == __test_expected_lines | select | list

        - name: Verify stonith configuration
          when:
            - "'pcmk.resource.config.output-formats' in __test_pcs_capabilities"
          vars:
            __test_expected_lines: >
                {
                    "primitives": [
                        {
                            "id": "fence-no-attrs",
                            "agent_name": {
                                "standard": "stonith",
                                "provider": null,
                                "type": "fence_kdump"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "fence-no-attrs-monitor-interval-60s",
                                    "name": "monitor",
                                    "interval": "60s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": null,
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "fence-empty-attrs1",
                            "agent_name": {
                                "standard": "stonith",
                                "provider": null,
                                "type": "fence_kdump"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "fence-empty-attrs1-monitor-interval-60s",
                                    "name": "monitor",
                                    "interval": "60s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": null,
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "fence-empty-attrs2",
                            "agent_name": {
                                "standard": "stonith",
                                "provider": null,
                                "type": "fence_kdump"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "fence-empty-attrs2-monitor-interval-60s",
                                    "name": "monitor",
                                    "interval": "60s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": null,
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "fence-with-attrs",
                            "agent_name": {
                                "standard": "stonith",
                                "provider": null,
                                "type": "fence_kdump"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "fence-with-attrs-monitor-interval-26",
                                    "name": "monitor",
                                    "interval": "26",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "13",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "fence-with-attrs-monitor-interval-28s",
                                    "name": "monitor",
                                    "interval": "28s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "14s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [
                                {
                                    "id": "fence-with-attrs-meta_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "fence-with-attrs-meta_attributes-an-attr",
                                            "name": "an-attr",
                                            "value": "a value"
                                        },
                                        {
                                            "id": "fence-with-attrs-meta_attributes-target-role",
                                            "name": "target-role",
                                            "value": "Stopped"
                                        }
                                    ]
                                }
                            ],
                            "instance_attributes": [
                                {
                                    "id": "fence-with-attrs-instance_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "fence-with-attrs-instance_attributes-pcmk_host_list",
                                            "name": "pcmk_host_list",
                                            "value": "node1 node2"
                                        },
                                        {
                                            "id": "fence-with-attrs-instance_attributes-timeout",
                                            "name": "timeout",
                                            "value": "30"
                                        }
                                    ]
                                }
                            ],
                            "utilization": []
                        }
                    ],
                    "clones": [],
                    "groups": [],
                    "bundles": []
                }
          block:
            - name: Fetch stonith configuration from the cluster
              command:
                cmd: pcs --output-format=json stonith config
              register: __test_pcs_stonith_config
              changed_when: false

            - name: Print real stonith configuration
              debug:
                var: __test_pcs_stonith_config.stdout | from_json

            - name: Print expected stonith configuration
              debug:
                var: __test_expected_lines | from_json

            - name: Check stonith configuration
              assert:
                that:
                  - __test_pcs_stonith_config.stdout | from_json == __test_expected_lines | from_json

        - name: Verify resource configuration
          when:
            - '"pcmk.resource.config.output-formats" not in __test_pcs_capabilities'
          vars:
            # wokeignore:rule=master
            __mstr: Master
            # wokeignore:rule=slave
            __slv: Slave
            # wokeignore:rule=dummy
            __dmy: Dummy
            # noqa jinja[spacing]
            __test_expected_lines:
              - ' Bundle: bundle-minimal'
              - '  Docker: image=my:image1'
              - ' Bundle: bundle-minimal-with-resource'
              - '  Docker: image=my:image1'
              - '  Network: control-port=3121'
              - '  Resource: test-bundle (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-bundle-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-bundle-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-bundle-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-bundle-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-bundle-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-bundle-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-bundle-stop-interval-0s)'
              - ' Bundle: bundle-all-options'
              - '  Docker: image=my:image1 replicas=2'
              - '  Network: control-port=3121 host-netmask=32'
              - '  Port Mapping:'
              - '   port=23456 (bundle-all-options-port-map-23456)'
              - '   internal-port=45678 port=34567 (bundle-all-options-port-map-34567)'
              - '  Storage Mapping:'
              - '   source-dir=/tmp/source1 target-dir=/tmp/target1 (bundle-all-options-storage-map)'
              - '   source-dir=/tmp/source2 target-dir=/tmp/target2 (bundle-all-options-storage-map-1)'
              - '  Meta Attrs: an-attr="a value" target-role=Stopped'
              - ' Resource: test-no-attrs (class=ocf provider=pacemaker type={{ __dmy }})'
              - '  Operations: migrate_from interval=0s timeout=20s (test-no-attrs-migrate_from-interval-0s)'
              - '              migrate_to interval=0s timeout=20s (test-no-attrs-migrate_to-interval-0s)'
              - '              monitor interval=10s timeout=20s (test-no-attrs-monitor-interval-10s)'
              - '              reload interval=0s timeout=20s (test-no-attrs-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '              reload-agent interval=0s timeout=20s (test-no-attrs-reload-agent-interval-0s)',
                '') }}"
              - '              start interval=0s timeout=20s (test-no-attrs-start-interval-0s)'
              - '              stop interval=0s timeout=20s (test-no-attrs-stop-interval-0s)'
              - ' Resource: test-empty-attrs1 (class=ocf provider=pacemaker type={{ __dmy }})'
              - '  Operations: migrate_from interval=0s timeout=20s (test-empty-attrs1-migrate_from-interval-0s)'
              - '              migrate_to interval=0s timeout=20s (test-empty-attrs1-migrate_to-interval-0s)'
              - '              monitor interval=10s timeout=20s (test-empty-attrs1-monitor-interval-10s)'
              - '              reload interval=0s timeout=20s (test-empty-attrs1-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '              reload-agent interval=0s timeout=20s (test-empty-attrs1-reload-agent-interval-0s)',
                '') }}"
              - '              start interval=0s timeout=20s (test-empty-attrs1-start-interval-0s)'
              - '              stop interval=0s timeout=20s (test-empty-attrs1-stop-interval-0s)'
              - ' Resource: test-empty-attrs2 (class=ocf provider=pacemaker type={{ __dmy }})'
              - '  Operations: migrate_from interval=0s timeout=20s (test-empty-attrs2-migrate_from-interval-0s)'
              - '              migrate_to interval=0s timeout=20s (test-empty-attrs2-migrate_to-interval-0s)'
              - '              monitor interval=10s timeout=20s (test-empty-attrs2-monitor-interval-10s)'
              - '              reload interval=0s timeout=20s (test-empty-attrs2-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '              reload-agent interval=0s timeout=20s (test-empty-attrs2-reload-agent-interval-0s)',
                '') }}"
              - '              start interval=0s timeout=20s (test-empty-attrs2-start-interval-0s)'
              - '              stop interval=0s timeout=20s (test-empty-attrs2-stop-interval-0s)'
              - ' Resource: test-with-attrs1 (class=ocf provider=pacemaker type={{ __dmy }})'
              - '  Attributes: fake="fake value"'
              - '  Meta Attrs: target-role=Stopped'
              - '  Operations: migrate_from interval=0s timeout=20s (test-with-attrs1-migrate_from-interval-0s)'
              - '              migrate_to interval=0s timeout=20s (test-with-attrs1-migrate_to-interval-0s)'
              - '              monitor interval=60s timeout=1min (test-with-attrs1-monitor-interval-60s)'
              - '              reload interval=0s timeout=20s (test-with-attrs1-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '              reload-agent interval=0s timeout=20s (test-with-attrs1-reload-agent-interval-0s)',
                '') }}"
              - '              start interval=0s timeout=20s (test-with-attrs1-start-interval-0s)'
              - '              stop interval=0s timeout=20s (test-with-attrs1-stop-interval-0s)'
              - ' Resource: test-with-attrs2 (class=ocf provider=pacemaker type={{ __dmy }})'
              - '  Attributes: fake="fake value" passwd="passwd value1"'
              - '  Meta Attrs: an-attr="a value" target-role=Stopped'
              - '  Operations: migrate_from interval=0s timeout=20s (test-with-attrs2-migrate_from-interval-0s)'
              - '              migrate_to interval=0s timeout=20s (test-with-attrs2-migrate_to-interval-0s)'
              - '              monitor interval=26 timeout=13 (test-with-attrs2-monitor-interval-26)'
              - '              monitor interval=28 timeout=14 (test-with-attrs2-monitor-interval-28)'
              - '              reload interval=0s timeout=20s (test-with-attrs2-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '              reload-agent interval=0s timeout=20s (test-with-attrs2-reload-agent-interval-0s)',
                '') }}"
              - '              start interval=0s timeout=20s (test-with-attrs2-start-interval-0s)'
              - '              stop interval=0s timeout=20s (test-with-attrs2-stop-interval-0s)'
              - ' Resource: test-no-default-ops (class=ocf provider=pacemaker type={{ __dmy }})'
              - '  Operations: monitor interval=10s timeout=20s (test-no-default-ops-monitor-interval-10s)'
              - ' Group: group1'
              - '  Resource: test-1a (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-1a-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-1a-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-1a-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-1a-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-1a-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-1a-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-1a-stop-interval-0s)'
              - '  Resource: test-1b (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-1b-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-1b-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-1b-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-1b-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-1b-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-1b-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-1b-stop-interval-0s)'
              - ' Group: group2'
              - '  Resource: test-2a (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-2a-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-2a-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-2a-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-2a-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-2a-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-2a-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-2a-stop-interval-0s)'
              - ' Group: group4'
              - '  Meta Attrs: an-attr="a value" target-role=Stopped'
              - '  Resource: test-4a (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-4a-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-4a-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-4a-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-4a-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-4a-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-4a-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-4a-stop-interval-0s)'
              - ' Clone: test-clone-no-options-clone'
              - '  Resource: test-clone-no-options (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-clone-no-options-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-clone-no-options-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-clone-no-options-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-clone-no-options-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-clone-no-options-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-clone-no-options-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-clone-no-options-stop-interval-0s)'
              - ' Clone: stateful-clone-promotable-clone'
              - '  Meta Attrs: promotable=true'
              - '  Resource: stateful-clone-promotable (class=ocf provider=pacemaker type=Stateful)'
              - '   Operations: demote interval=0s timeout=10s (stateful-clone-promotable-demote-interval-0s)'
              - '               monitor interval=10s role={{ __mstr }} timeout=20s (stateful-clone-promotable-monitor-interval-10s)'
              - '               monitor interval=11s role={{ __slv }} timeout=20s (stateful-clone-promotable-monitor-interval-11s)'
              - '               notify interval=0s timeout=5s (stateful-clone-promotable-notify-interval-0s)'
              - '               promote interval=0s timeout=10s (stateful-clone-promotable-promote-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=10s (stateful-clone-promotable-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (stateful-clone-promotable-start-interval-0s)'
              - '               stop interval=0s timeout=20s (stateful-clone-promotable-stop-interval-0s)'
              - ' Clone: {{
                    ("pcmk.resource.clone.custom-id" in __test_pcs_capabilities)
                    | ternary("custom-clone-id1", "test-clone-id-clone") }}'
              - '  Resource: test-clone-id (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-clone-id-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-clone-id-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-clone-id-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-clone-id-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-clone-id-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-clone-id-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-clone-id-stop-interval-0s)'
              - ' Clone: test-clone-empty-attrs1-clone'
              - '  Resource: test-clone-empty-attrs1 (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-clone-empty-attrs1-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-clone-empty-attrs1-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-clone-empty-attrs1-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-clone-empty-attrs1-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-clone-empty-attrs1-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-clone-empty-attrs1-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-clone-empty-attrs1-stop-interval-0s)'
              - ' Clone: test-clone-empty-attrs2-clone'
              - '  Resource: test-clone-empty-attrs2 (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-clone-empty-attrs2-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-clone-empty-attrs2-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-clone-empty-attrs2-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-clone-empty-attrs2-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-clone-empty-attrs2-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-clone-empty-attrs2-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-clone-empty-attrs2-stop-interval-0s)'
              - ' Clone: test-clone-with-attrs1-clone'
              - '  Meta Attrs: target-role=Stopped'
              - '  Resource: test-clone-with-attrs1 (class=ocf provider=pacemaker type={{ __dmy }})'
              - '   Operations: migrate_from interval=0s timeout=20s (test-clone-with-attrs1-migrate_from-interval-0s)'
              - '               migrate_to interval=0s timeout=20s (test-clone-with-attrs1-migrate_to-interval-0s)'
              - '               monitor interval=10s timeout=20s (test-clone-with-attrs1-monitor-interval-10s)'
              - '               reload interval=0s timeout=20s (test-clone-with-attrs1-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=20s (test-clone-with-attrs1-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (test-clone-with-attrs1-start-interval-0s)'
              - '               stop interval=0s timeout=20s (test-clone-with-attrs1-stop-interval-0s)'
              - ' Clone: {{
                    ("pcmk.resource.promotable.custom-id" in __test_pcs_capabilities)
                    | ternary("custom-clone-id2", "stateful-clone-with-attrs2-clone") }}'
              - '  Meta Attrs: an-attr="a value" promotable=true target-role=Stopped'
              - '  Resource: stateful-clone-with-attrs2 (class=ocf provider=pacemaker type=Stateful)'
              - '   Operations: demote interval=0s timeout=10s (stateful-clone-with-attrs2-demote-interval-0s)'
              - '               monitor interval=10s role={{ __mstr }} timeout=20s (stateful-clone-with-attrs2-monitor-interval-10s)'
              - '               monitor interval=11s role={{ __slv }} timeout=20s (stateful-clone-with-attrs2-monitor-interval-11s)'
              - '               notify interval=0s timeout=5s (stateful-clone-with-attrs2-notify-interval-0s)'
              - '               promote interval=0s timeout=10s (stateful-clone-with-attrs2-promote-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '               reload-agent interval=0s timeout=10s (stateful-clone-with-attrs2-reload-agent-interval-0s)',
                '') }}"
              - '               start interval=0s timeout=20s (stateful-clone-with-attrs2-start-interval-0s)'
              - '               stop interval=0s timeout=20s (stateful-clone-with-attrs2-stop-interval-0s)'
              - ' Clone: group3-clone'
              - '  Group: group3'
              - '   Resource: test-3a (class=ocf provider=pacemaker type={{ __dmy }})'
              - '    Operations: migrate_from interval=0s timeout=20s (test-3a-migrate_from-interval-0s)'
              - '                migrate_to interval=0s timeout=20s (test-3a-migrate_to-interval-0s)'
              - '                monitor interval=10s timeout=20s (test-3a-monitor-interval-10s)'
              - '                reload interval=0s timeout=20s (test-3a-reload-interval-0s)'
              - "{{ ansible_facts.packages['pacemaker'][0]['version'] is version('2.1', '>=') | ternary(
                '                reload-agent interval=0s timeout=20s (test-3a-reload-agent-interval-0s)',
                '') }}"
              - '                start interval=0s timeout=20s (test-3a-start-interval-0s)'
              - '                stop interval=0s timeout=20s (test-3a-stop-interval-0s)'
          block:
            - name: Fetch resource configuration from the cluster
              command:
                cmd: pcs resource config
              register: __test_pcs_resource_config
              changed_when: false

            - name: Print real resource configuration
              debug:
                var: __test_pcs_resource_config.stdout_lines

            - name: Print expected resource configuration
              debug:
                var: __test_expected_lines | select | list

            - name: Check resource configuration
              assert:
                that:
                  - __test_pcs_resource_config.stdout_lines == __test_expected_lines | select | list

        - name: Verify resource configuration
          when:
            - "'pcmk.resource.config.output-formats' in __test_pcs_capabilities"
          vars:
            __old_clone_roles: "{{
              (ansible_facts['distribution'] in ['RedHat', 'CentOS']
               and
               ansible_facts['distribution_major_version'] == '8') |
               bool }}"
            # wokeignore:rule=master
            __mstr: Master
            # wokeignore:rule=slave
            __slv: Slave
            # wokeignore:rule=dummy
            __dmy: Dummy
            __promoted: "{{ __old_clone_roles | ternary(__mstr, 'Promoted') }}"
            __unpromoted: "{{ __old_clone_roles | ternary(__slv, 'Unpromoted') }}"
            __test_expected_lines: '
                {
                    "primitives": [
                        {
                            "agent_name": {
                                "provider": "pacemaker",
                                "standard": "ocf",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "id": "test-bundle",
                            "instance_attributes": [],
                            "meta_attributes": [],
                            "operations": [
                                {
                                    "description": null,
                                    "enabled": null,
                                    "id": "test-bundle-migrate_from-interval-0s",
                                    "instance_attributes": [],
                                    "interval": "0s",
                                    "interval_origin": null,
                                    "meta_attributes": [],
                                    "name": "migrate_from",
                                    "on_fail": null,
                                    "record_pending": null,
                                    "role": null,
                                    "start_delay": null,
                                    "timeout": "20s"
                                },
                                {
                                    "description": null,
                                    "enabled": null,
                                    "id": "test-bundle-migrate_to-interval-0s",
                                    "instance_attributes": [],
                                    "interval": "0s",
                                    "interval_origin": null,
                                    "meta_attributes": [],
                                    "name": "migrate_to",
                                    "on_fail": null,
                                    "record_pending": null,
                                    "role": null,
                                    "start_delay": null,
                                    "timeout": "20s"
                                },
                                {
                                    "description": null,
                                    "enabled": null,
                                    "id": "test-bundle-monitor-interval-10s",
                                    "instance_attributes": [],
                                    "interval": "10s",
                                    "interval_origin": null,
                                    "meta_attributes": [],
                                    "name": "monitor",
                                    "on_fail": null,
                                    "record_pending": null,
                                    "role": null,
                                    "start_delay": null,
                                    "timeout": "20s"
                                },
                                {
                                    "description": null,
                                    "enabled": null,
                                    "id": "test-bundle-reload-interval-0s",
                                    "instance_attributes": [],
                                    "interval": "0s",
                                    "interval_origin": null,
                                    "meta_attributes": [],
                                    "name": "reload",
                                    "on_fail": null,
                                    "record_pending": null,
                                    "role": null,
                                    "start_delay": null,
                                    "timeout": "20s"
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "description": null,
                                    "enabled": null,
                                    "id": "test-bundle-reload-agent-interval-0s",
                                    "instance_attributes": [],
                                    "interval": "0s",
                                    "interval_origin": null,
                                    "meta_attributes": [],
                                    "name": "reload-agent",
                                    "on_fail": null,
                                    "record_pending": null,
                                    "role": null,
                                    "start_delay": null,
                                    "timeout": "20s"
                                },
                            {% endif %}
                                {
                                    "description": null,
                                    "enabled": null,
                                    "id": "test-bundle-start-interval-0s",
                                    "instance_attributes": [],
                                    "interval": "0s",
                                    "interval_origin": null,
                                    "meta_attributes": [],
                                    "name": "start",
                                    "on_fail": null,
                                    "record_pending": null,
                                    "role": null,
                                    "start_delay": null,
                                    "timeout": "20s"
                                },
                                {
                                    "description": null,
                                    "enabled": null,
                                    "id": "test-bundle-stop-interval-0s",
                                    "instance_attributes": [],
                                    "interval": "0s",
                                    "interval_origin": null,
                                    "meta_attributes": [],
                                    "name": "stop",
                                    "on_fail": null,
                                    "record_pending": null,
                                    "role": null,
                                    "start_delay": null,
                                    "timeout": "20s"
                                }
                            ],
                            "utilization": []
                        },
                        {
                            "id": "test-no-attrs",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-no-attrs-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-no-attrs-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-no-attrs-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-no-attrs-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-no-attrs-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-no-attrs-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-no-attrs-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-empty-attrs1",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-empty-attrs1-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs1-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs1-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs1-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-empty-attrs1-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-empty-attrs1-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs1-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-empty-attrs2",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-empty-attrs2-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs2-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs2-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs2-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-empty-attrs2-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-empty-attrs2-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-empty-attrs2-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-with-attrs1",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-with-attrs1-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs1-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs1-monitor-interval-60s",
                                    "name": "monitor",
                                    "interval": "60s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "1min",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs1-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-with-attrs1-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-with-attrs1-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs1-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [
                                {
                                    "id": "test-with-attrs1-meta_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "test-with-attrs1-meta_attributes-target-role",
                                            "name": "target-role",
                                            "value": "Stopped"
                                        }
                                    ]
                                }
                            ],
                            "instance_attributes": [
                                {
                                    "id": "test-with-attrs1-instance_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "test-with-attrs1-instance_attributes-fake",
                                            "name": "fake",
                                            "value": "fake value"
                                        }
                                    ]
                                }
                            ],
                            "utilization": []
                        },
                        {
                            "id": "test-with-attrs2",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-with-attrs2-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs2-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs2-monitor-interval-26",
                                    "name": "monitor",
                                    "interval": "26",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "13",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs2-monitor-interval-28",
                                    "name": "monitor",
                                    "interval": "28",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "14",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs2-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-with-attrs2-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-with-attrs2-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-with-attrs2-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [
                                {
                                    "id": "test-with-attrs2-meta_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "test-with-attrs2-meta_attributes-an-attr",
                                            "name": "an-attr",
                                            "value": "a value"
                                        },
                                        {
                                            "id": "test-with-attrs2-meta_attributes-target-role",
                                            "name": "target-role",
                                            "value": "Stopped"
                                        }
                                    ]
                                }
                            ],
                            "instance_attributes": [
                                {
                                    "id": "test-with-attrs2-instance_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "test-with-attrs2-instance_attributes-fake",
                                            "name": "fake",
                                            "value": "fake value"
                                        },
                                        {
                                            "id": "test-with-attrs2-instance_attributes-passwd",
                                            "name": "passwd",
                                            "value": "passwd value1"
                                        }
                                    ]
                                }
                            ],
                            "utilization": []
                        },
                        {
                            "id": "test-no-default-ops",
                            "agent_name": {
                                "provider": "pacemaker",
                                "standard": "ocf",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-no-default-ops-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-1a",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-1a-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1a-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1a-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1a-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-1a-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-1a-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1a-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-1b",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-1b-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1b-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1b-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1b-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-1b-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-1b-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-1b-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-2a",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-2a-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-2a-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-2a-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-2a-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-2a-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-2a-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-2a-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-4a",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-4a-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-4a-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-4a-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-4a-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-4a-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-4a-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-4a-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-clone-no-options",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-clone-no-options-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-no-options-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-no-options-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-no-options-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-clone-no-options-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-clone-no-options-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-no-options-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "stateful-clone-promotable",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "Stateful"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "stateful-clone-promotable-demote-interval-0s",
                                    "name": "demote",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "10s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-promotable-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": "{{ __promoted }}",
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-promotable-monitor-interval-11s",
                                    "name": "monitor",
                                    "interval": "11s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": "{{ __unpromoted }}",
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-promotable-notify-interval-0s",
                                    "name": "notify",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "5s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-promotable-promote-interval-0s",
                                    "name": "promote",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "10s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "stateful-clone-promotable-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "10s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "stateful-clone-promotable-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-promotable-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-clone-id",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-clone-id-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-id-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-id-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-id-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-clone-id-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-clone-id-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-id-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-clone-empty-attrs1",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-clone-empty-attrs1-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs1-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs1-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs1-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-clone-empty-attrs1-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-clone-empty-attrs1-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs1-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-clone-empty-attrs2",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-clone-empty-attrs2-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs2-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs2-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs2-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-clone-empty-attrs2-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-clone-empty-attrs2-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-empty-attrs2-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-clone-with-attrs1",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-clone-with-attrs1-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-with-attrs1-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-with-attrs1-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-with-attrs1-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-clone-with-attrs1-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-clone-with-attrs1-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-clone-with-attrs1-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "stateful-clone-with-attrs2",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "Stateful"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "stateful-clone-with-attrs2-demote-interval-0s",
                                    "name": "demote",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "10s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-with-attrs2-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": "{{ __promoted }}",
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-with-attrs2-monitor-interval-11s",
                                    "name": "monitor",
                                    "interval": "11s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": "{{ __unpromoted }}",
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-with-attrs2-notify-interval-0s",
                                    "name": "notify",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "5s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-with-attrs2-promote-interval-0s",
                                    "name": "promote",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "10s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "stateful-clone-with-attrs2-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "10s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "stateful-clone-with-attrs2-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "stateful-clone-with-attrs2-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        },
                        {
                            "id": "test-3a",
                            "agent_name": {
                                "standard": "ocf",
                                "provider": "pacemaker",
                                "type": "{{ __dmy }}"
                            },
                            "description": null,
                            "operations": [
                                {
                                    "id": "test-3a-migrate_from-interval-0s",
                                    "name": "migrate_from",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-3a-migrate_to-interval-0s",
                                    "name": "migrate_to",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-3a-monitor-interval-10s",
                                    "name": "monitor",
                                    "interval": "10s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-3a-reload-interval-0s",
                                    "name": "reload",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% if ansible_facts.packages["pacemaker"][0]["version"] is version("2.1", ">=") %}
                                {
                                    "id": "test-3a-reload-agent-interval-0s",
                                    "name": "reload-agent",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                            {% endif %}
                                {
                                    "id": "test-3a-start-interval-0s",
                                    "name": "start",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                },
                                {
                                    "id": "test-3a-stop-interval-0s",
                                    "name": "stop",
                                    "interval": "0s",
                                    "description": null,
                                    "start_delay": null,
                                    "interval_origin": null,
                                    "timeout": "20s",
                                    "enabled": null,
                                    "record_pending": null,
                                    "role": null,
                                    "on_fail": null,
                                    "meta_attributes": [],
                                    "instance_attributes": []
                                }
                            ],
                            "meta_attributes": [],
                            "instance_attributes": [],
                            "utilization": []
                        }
                    ],
                    "clones": [
                        {
                            "id": "test-clone-no-options-clone",
                            "description": null,
                            "member_id": "test-clone-no-options",
                            "meta_attributes": [],
                            "instance_attributes": []
                        },
                        {
                            "id": "stateful-clone-promotable-clone",
                            "description": null,
                            "member_id": "stateful-clone-promotable",
                            "meta_attributes": [
                                {
                                    "id": "stateful-clone-promotable-clone-meta_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "stateful-clone-promotable-clone-meta_attributes-promotable",
                                            "name": "promotable",
                                            "value": "true"
                                        }
                                    ]
                                }
                            ],
                            "instance_attributes": []
                        },
                        {
                            "id": "custom-clone-id1",
                            "description": null,
                            "member_id": "test-clone-id",
                            "meta_attributes": [],
                            "instance_attributes": []
                        },
                        {
                            "id": "test-clone-empty-attrs1-clone",
                            "description": null,
                            "member_id": "test-clone-empty-attrs1",
                            "meta_attributes": [],
                            "instance_attributes": []
                        },
                        {
                            "id": "test-clone-empty-attrs2-clone",
                            "description": null,
                            "member_id": "test-clone-empty-attrs2",
                            "meta_attributes": [],
                            "instance_attributes": []
                        },
                        {
                            "id": "test-clone-with-attrs1-clone",
                            "description": null,
                            "member_id": "test-clone-with-attrs1",
                            "meta_attributes": [
                                {
                                    "id": "test-clone-with-attrs1-clone-meta_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "test-clone-with-attrs1-clone-meta_attributes-target-role",
                                            "name": "target-role",
                                            "value": "Stopped"
                                        }
                                    ]
                                }
                            ],
                            "instance_attributes": []
                        },
                        {
                            "id": "custom-clone-id2",
                            "description": null,
                            "member_id": "stateful-clone-with-attrs2",
                            "meta_attributes": [
                                {
                                    "id": "custom-clone-id2-meta_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "custom-clone-id2-meta_attributes-an-attr",
                                            "name": "an-attr",
                                            "value": "a value"
                                        },
                                        {
                                            "id": "custom-clone-id2-meta_attributes-promotable",
                                            "name": "promotable",
                                            "value": "true"
                                        },
                                        {
                                            "id": "custom-clone-id2-meta_attributes-target-role",
                                            "name": "target-role",
                                            "value": "Stopped"
                                        }
                                    ]
                                }
                            ],
                            "instance_attributes": []
                        },
                        {
                            "id": "group3-clone",
                            "description": null,
                            "member_id": "group3",
                            "meta_attributes": [],
                            "instance_attributes": []
                        }
                    ],
                    "groups": [
                        {
                            "id": "group1",
                            "description": null,
                            "member_ids": [
                                "test-1a",
                                "test-1b"
                            ],
                            "meta_attributes": [],
                            "instance_attributes": []
                        },
                        {
                            "id": "group2",
                            "description": null,
                            "member_ids": [
                                "test-2a"
                            ],
                            "meta_attributes": [],
                            "instance_attributes": []
                        },
                        {
                            "id": "group4",
                            "description": null,
                            "member_ids": [
                                "test-4a"
                            ],
                            "meta_attributes": [
                                {
                                    "id": "group4-meta_attributes",
                                    "options": {},
                                    "rule": null,
                                    "nvpairs": [
                                        {
                                            "id": "group4-meta_attributes-an-attr",
                                            "name": "an-attr",
                                            "value": "a value"
                                        },
                                        {
                                            "id": "group4-meta_attributes-target-role",
                                            "name": "target-role",
                                            "value": "Stopped"
                                        }
                                    ]
                                }
                            ],
                            "instance_attributes": []
                        },
                        {
                            "id": "group3",
                            "description": null,
                            "member_ids": [
                                "test-3a"
                            ],
                            "meta_attributes": [],
                            "instance_attributes": []
                        }
                    ],
                    "bundles": [
                        {
                            "container_options": {
                                "image": "my:image1",
                                "network": null,
                                "options": null,
                                "promoted_max": null,
                                "replicas": null,
                                "replicas_per_host": null,
                                "run_command": null
                            },
                            "container_type": "docker",
                            "description": null,
                            "id": "bundle-minimal",
                            "instance_attributes": [],
                            "member_id": null,
                            "meta_attributes": [],
                            "network": null,
                            "port_mappings": [],
                            "storage_mappings": []
                        },
                        {
                            "container_options": {
                                "image": "my:image1",
                                "network": null,
                                "options": null,
                                "promoted_max": null,
                                "replicas": null,
                                "replicas_per_host": null,
                                "run_command": null
                            },
                            "container_type": "docker",
                            "description": null,
                            "id": "bundle-minimal-with-resource",
                            "instance_attributes": [],
                            "member_id": "test-bundle",
                            "meta_attributes": [],
                            "network": {
                                "add_host": null,
                                "control_port": 3121,
                                "host_interface": null,
                                "host_netmask": null,
                                "ip_range_start": null
                            },
                            "port_mappings": [],
                            "storage_mappings": []
                        },
                        {
                            "container_options": {
                                "image": "my:image1",
                                "network": null,
                                "options": null,
                                "promoted_max": null,
                                "replicas": 2,
                                "replicas_per_host": null,
                                "run_command": null
                            },
                            "container_type": "docker",
                            "description": null,
                            "id": "bundle-all-options",
                            "instance_attributes": [],
                            "member_id": null,
                            "meta_attributes": [
                                {
                                    "id": "bundle-all-options-meta_attributes",
                                    "nvpairs": [
                                        {
                                            "id": "bundle-all-options-meta_attributes-an-attr",
                                            "name": "an-attr",
                                            "value": "a value"
                                        },
                                        {
                                            "id": "bundle-all-options-meta_attributes-target-role",
                                            "name": "target-role",
                                            "value": "Stopped"
                                        }
                                    ],
                                    "options": {},
                                    "rule": null
                                }
                            ],
                            "network": {
                                "add_host": null,
                                "control_port": 3121,
                                "host_interface": null,
                                "host_netmask": 32,
                                "ip_range_start": null
                            },
                            "port_mappings": [
                                {
                                    "id": "bundle-all-options-port-map-23456",
                                    "internal_port": null,
                                    "port": 23456,
                                    "range": null
                                },
                                {
                                    "id": "bundle-all-options-port-map-34567",
                                    "internal_port": 45678,
                                    "port": 34567,
                                    "range": null
                                }
                            ],
                            "storage_mappings": [
                                {
                                    "id": "bundle-all-options-storage-map",
                                    "options": null,
                                    "source_dir": "/tmp/source1",
                                    "source_dir_root": null,
                                    "target_dir": "/tmp/target1"
                                },
                                {
                                    "id": "bundle-all-options-storage-map-1",
                                    "options": null,
                                    "source_dir": "/tmp/source2",
                                    "source_dir_root": null,
                                    "target_dir": "/tmp/target2"
                                }
                            ]
                        }
                    ]
                }'
          block:
            - name: Fetch resource configuration from the cluster
              command:
                cmd: pcs --output-format=json resource config
              register: __test_pcs_resource_config
              changed_when: false

            - name: Print real resource configuration
              debug:
                var: __test_pcs_resource_config.stdout | from_json

            - name: Print expected resource configuration
              debug:
                var: __test_expected_lines | from_json

            - name: Check resource configuration
              assert:
                that:
                  - __test_pcs_resource_config.stdout | from_json == __test_expected_lines | from_json

        - name: Check firewall and selinux state
          include_tasks: tasks/check_firewall_selinux.yml
