summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/rule-args-module-pass.yml
blob: 995e4fe0d5c375e5ca4ac3add89ab23169fb4cb5 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
- name: Fixture to validate module options pass scenario
  hosts: localhost
  tasks:
    - name: Clone content repository
      ansible.builtin.git:
        repo: "{{ archive_services_repo_url }}"
        dest: /home/www
        accept_hostkey: true
        version: master
        update: false

    - name: Enable service httpd and ensure it is not masked
      ansible.builtin.systemd:
        name: httpd
        enabled: false
        masked: false

    - name: Clear deployment dir
      ansible.builtin.file:
        path: /opt/software/deployment
        state: "{{ item }}"
        mode: "0755"
      with_items:
        - absent
        - directory

    - name: Bug https://github.com/ansible/ansible-lint/issues/2962
      become: true
      ansible.builtin.apt_key:
        url: "{{ zj_item['url'] | default(omit) }}"
        data: "{{ zj_item['data'] | default(omit) }}"
      loop: "{{ repositories_keys }}"
      loop_control:
        loop_var: zj_item

    - name: Bug 2428 daemon_reload should be allowed
      ansible.builtin.systemd:
        name: foo
        state: restarted
        daemon_reload: true

    - name: Bug 2424 async_status
      ansible.builtin.async_status:
        jid: "{{ 999 }}"

    - name: Bug https://github.com/VSChina/vscode-ansible/issues/261
      ansible.builtin.set_fact:
        dns_nameservers: "{{ var1 }}"

    - name: Bug cmd should be allowed
      ansible.builtin.command:
        cmd: echo "foo"
      changed_when: false

    - name: Bag another allowed form of command
      ansible.builtin.command: "/etc/test.sh"
      changed_when: false

    - name: Bug 3090
      community.docker.docker_container_exec:
        container: foo
        argv:
          - /bin/bash
          - "-c"
          - "ls -lah > /dev/stderr"
        chdir: /root
      register: result

    - name: "Bug 3138"
      become: true
      ansible.builtin.service:
        name: "jenkins"
        state: started
        # 'use' is dropped by preprocessing ...
        use: "{{ ansible_service_mgr }}"
      changed_when: false

    - name: "Bug 3152"
      ansible.posix.synchronize:
        src: .
        dest: .
        owner: false
        group: false
        use_ssh_args: true

    - name: Create software directory (Windows module - Bug 3200)
      ansible.windows.win_file:
        path: "c:\\test_dir"
        state: directory

    - name: Ansible-lint for args rule should succeed (Bug - 3199)
      vars:
        copy_vars:
          src: "args.json"
      action: ansible.builtin.copy
      args: "{{ copy_vars }}" # since, we're unable to analyze jinja, we skip this kind of checks