]> git.somenet.org - root/pub/somesible.git/blob - roles/client/kiosk_mode/tasks/main.yml
roles/base/backup/files
[root/pub/somesible.git] / roles / client / kiosk_mode / tasks / main.yml
1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
6 #
7 ---
8 - name: create kiosk user
9   user:
10     name: "kiosk"
11     home: "/home/kiosk"
12 #    shell: "/bin/bash"
13     createhome: no
14     state: present
15
16
17 - name: create kiosk user's homedir
18   file:
19     path: "/home/kiosk"
20     state: directory
21     mode: 0770
22     owner: "kiosk"
23     group: "kiosk"
24
25
26 - name: copy lightdm.conf config
27   copy:
28     src: "{{item}}"
29     dest: "/etc/lightdm/lightdm.conf"
30     mode: 0644
31     owner: "root"
32     group: "root"
33   with_first_found:
34     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/lightdm.conf"
35     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/lightdm.conf"
36     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/lightdm.conf"
37     - "default/lightdm.conf"
38
39
40 - name: copy kiosk.sh
41   copy:
42     src: "{{item}}"
43     dest: "/etc/kiosk.sh"
44     mode: 0755
45     owner: "root"
46     group: "root"
47   with_first_found:
48     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/kiosk.sh"
49     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/kiosk.sh"
50     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/kiosk.sh"
51     - "default/kiosk.sh"
52
53
54 - name: copy kiosk.tar.bz2
55   copy:
56     src: "{{item}}"
57     dest: "/etc/kiosk.tar.bz2"
58     mode: 0600
59     owner: "root"
60     group: "root"
61   with_first_found:
62     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/kiosk.tar.bz2"
63     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/kiosk.tar.bz2"
64     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/kiosk.tar.bz2"
65     - "default/kiosk.tar.bz2"
66   register: copy
67
68
69 - name: delete kiosk-skel-dir
70   file:
71     path: "/etc/kiosk"
72     state: absent
73   when: copy.changed
74
75
76 - name: set up new kiosk-skel-dir
77   file:
78     path: "/etc/kiosk"
79     state: directory
80     mode: 0700
81     owner: "kiosk"
82     group: "kiosk"
83   when: copy.changed
84
85
86 - name: extract kiosk-skel-dir
87   unarchive:
88     src: "/etc/kiosk.tar.bz2"
89     dest: "/etc/kiosk"
90     remote_src: yes
91     mode: "u=rwX,g=rX,o-rwx"
92     owner: "kiosk"
93     group: "kiosk"
94     extra_opts:
95       - '--strip-components=1'
96       - '--show-stored-names'
97   when: copy.changed
98
99
100 - name: set up persistent kiosk storage
101   file:
102     path: "/var/kiosk"
103     state: directory
104     mode: 0775
105     owner: "kiosk"
106     group: "kiosk"
107
108 #TODO: deny crontab + at