summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/yum/tasks/lock.yml
blob: 3f585c1daaebdb7e031f2e01e445c1c1fbf9bdbf (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
- block:
  - name: Make sure testing package is not installed
    yum:
      name: sos
      state: absent

  - name: Create bogus lock file
    copy:
      content: bogus content for this lock file
      dest: /var/run/yum.pid

  - name: Install a package, lock file should be deleted by the module
    yum:
      name: sos
      state: present
    register: yum_result

  - assert:
      that:
        - yum_result is success

  always:
    - name: Clean up
      yum:
        name: sos
        state: absent

  when: ansible_pkg_mgr == 'yum'