aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/molecule/default/prepare.yml
blob: 70764e7d8b6857353e2e696dbf08c40ec8fa3cbf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- name: Prepare Prometheus target fixtures
  hosts: prometheus
  gather_facts: false
  become: true

  tasks:
    - name: Create Prometheus test user
      ansible.builtin.user:
        name: prometheus

    - name: Reset fixtures that exercise parallel writes
      ansible.builtin.copy:
        dest: "{{ item }}"
        mode: "0644"
        content: |
          - labels:
              job: node
            targets:
              - existing:9100
      loop:
        - /opt/yaml_parallel.yml
        - /opt/yaml_parallel_second.yml

    # These are intentionally not consumed yet. They provide stable starting
    # states for the planned exporter state/removal coverage in both strategies.
    - name: Prepare future YAML removal fixture
      ansible.builtin.copy:
        dest: /opt/yaml_state_removal.yml
        mode: "0644"
        content: |
          - labels:
              job: shared
            targets:
              - keep:9100
              - remove:9100
          - labels:
              job: remove_last
            targets:
              - remove:9200

    - name: Prepare future lineinfile removal fixture
      ansible.builtin.copy:
        dest: /opt/lineinfile_state_removal.yml
        mode: "0644"
        content: |
          - labels:
              job: shared
            targets:
              - keep:9100
              - remove:9100
          - labels:
              job: remove_last
            targets:
              - remove:9200