File: template_ANSIBLE_mount_option_var

package info (click to toggle)
scap-security-guide 0.1.39-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 31,836 kB
  • sloc: xml: 129,736; python: 7,462; sh: 3,796; makefile: 27
file content (38 lines) | stat: -rw-r--r-- 972 bytes parent folder | download
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
# platform = multi_platform_all
# reboot = false
# strategy = configure
# complexity = low
# disruption = high
- (xccdf-var %MOUNTPOINT%)

- name: get back device associated to mountpoint
  shell: mount | grep ' {{ %MOUNTPOINT% }} ' |cut -d ' ' -f 1
  register: device_name
  check_mode: no
  tags:
    @ANSIBLE_TAGS@

- name: get back device previous mount option
  shell: mount | grep ' {{ %MOUNTPOINT% }} ' | sed -re 's:.*\((.*)\):\1:'
  register: device_cur_mountoption
  check_mode: no
  tags:
    @ANSIBLE_TAGS@

- name: get back device fstype
  shell: mount | grep ' {{ %MOUNTPOINT% }} ' | cut -d ' ' -f 5
  register: device_fstype
  check_mode: no
  tags:
    @ANSIBLE_TAGS@

- name: Ensure permission %MOUNTOPTION% are set on %MOUNTPOINT%
  mount:
    path: "{{ %MOUNTPOINT% }}"
    src: "{{device_name.stdout}}"
    opts: "{{ device_cur_mountoption.stdout }},%MOUNTOPTION%"
    state: "mounted"
    fstype: "{{device_fstype.stdout}}"
  tags:
    @ANSIBLE_TAGS@