Skip to content

Commit 478586c

Browse files
authored
Merge pull request #17 from juanjoselopezroldan/master
update file init-time-suspend.sh for correct if
2 parents f6fa07c + 242171d commit 478586c

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

inventory/local/hosts.ini

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
node-1 ansible_host=192.168.1.35 ansible_port=22 ansible_user='usuario' ansible_sudo_pass=usuario ansible_ssh_private_key_file='~/.ssh/id_rsa.pub'
1+
node-1 ansible_host=192.168.1.36 ansible_port=22 ansible_user='usuario' ansible_sudo_pass=usuario ansible_ssh_private_key_file='~/.ssh/id_rsa.pub'
22
node-2 ansible_host=192.168.1.33 ansible_port=22 ansible_user='usuario' ansible_sudo_pass=usuario ansible_ssh_private_key_file='~/.ssh/id_rsa.pub'
33

44
[bind9]
@@ -13,8 +13,8 @@ node-1
1313
; [apple]
1414
; node-2
1515

16-
[sssd]
17-
node-2
16+
; [sssd]
17+
; node-2
1818

19-
[screen_lock]
20-
node-2
19+
; [screen_lock]
20+
; node-2

roles/screen_lock/tasks/config_lock.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
- name: Update apt and install xprintidle
2+
apt:
3+
name: "{{ packages }}"
4+
update_cache: yes
5+
vars:
6+
packages:
7+
- xprintidle
8+
19
- name: config_systemd | configuring xss
210
template:
311
src: "lock.service.j2"

roles/screen_lock/templates/init-time-suspend.sh.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ if ldapsearch -x -b "cn={{ name_suspend }},{{ openldap_base }}" -H ldap://ldap.{
2121
suspend_second=$(ldapsearch -x -b "cn={{ name_suspend }},{{ openldap_base }}" -H ldap://ldap.{{ domain }} | grep 'description' | cut -d '-' -f 2)
2222
echo "$suspend_second" > /etc/time_suspend
2323
else
24-
if ! -f /etc/time_suspend ; then
24+
if [ -f /etc/time_suspend ]; then
2525
suspend_second=$(cat /etc/time_suspend)
2626
else
27-
echo "300" > /etc/time_suspend
27+
echo "600" > /etc/time_suspend
2828
suspend_second=$(cat /etc/time_suspend)
2929
fi
3030
fi

roles/screen_lock/templates/suspend.service.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Unit]
2-
Description=XAUTOLOCK-SUSPEND
2+
Description=SUSPEND
33
After=network.target
44
StartLimitIntervalSec=0
55

0 commit comments

Comments
 (0)