forked from lastsky/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook-mc.yml
50 lines (44 loc) · 1.62 KB
/
playbook-mc.yml
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
---
# vi: :shiftwidth=2:nu:ai:set tabstop=2:softtabstop=2:expandtab
- hosts: all
gather_facts: no
vars:
ini_true: "{{ true | bool | lower }}"
ini_false: "{{ false | bool | lower }}"
mc_ini:
- section: Midnight-Commander
data:
- { key: mcview_remember_file_position, val: 1 }
- { key: auto_save_setup_panels, val: 1 }
- { key: use_internal_view, val: 1 }
- { key: use_internal_edit, val: 1 }
- { key: confirm_delete, val: 1 }
- { key: confirm_exit, val: 0 }
- { key: classic_progressbar, val: 0 }
- section: Layout
data:
- { key: menubar_visible, val: 0 }
- { key: message_visible, val: 0 }
- section: Panels
data:
- { key: navigate_with_arrows, val: "{{ ini_true }}" }
- { key: mix_all_files, val: "{{ ini_true }}" }
- { key: show_backups, val: "{{ ini_true }}" }
- { key: show_dot_files, val: "{{ ini_true }}" }
tasks:
- name: Checking if MC ini exists (for current user)
stat: path=~/.config/mc/ini
register: stat_mcini
- name: Warn mc ini was not found
debug: msg="Couldn not find existing mc ini"
#assert: { that: stat_mcini.stat.exists == True, msg: FFF }
when: stat_mcini.stat.exists == False
- name: Setting up specified values to mc ini
when: stat_mcini.stat.exists == True
ini_file: dest=~/.config/mc/ini
section={{ item.0.section }}
option={{ item.1.key }}
value={{ item.1.val }}
with_subelements:
- "{{ tr }}"
- data