remove scripts_dir variables

This commit is contained in:
Jérémy Lecour 2016-12-19 14:19:35 +01:00 committed by Jérémy Lecour
parent 343b384fc7
commit b8ebc30ba1
9 changed files with 8 additions and 22 deletions

View file

@ -23,7 +23,3 @@ evolinux_admin_users:
password_hash: 'gsdfgsdfgsdfgsdf'
ssh_key: 'ssh-rsa QWERTYUIOP'
```
* `general_scripts_dir`: general directory for scripts installation (default: `/usr/local/bin`).
* `listupgrade_scripts_dir`: script directory for listupgrade (default: `general_scripts_dir`).
* `evomaintenance_scripts_dir`: script directory for evomaintenance (default: `general_scripts_dir`).

View file

@ -1,6 +1,2 @@
---
evolinux_admin_users: []
general_scripts_dir: "/usr/local/bin"
evomaintenance_scripts_dir: Null
listupgrade_scripts_dir: Null

View file

@ -35,7 +35,7 @@
- name: is evomaintenance installed?
stat:
path: "{{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/evomaintenance.sh"
path: "/usr/share/scripts/evomaintenance.sh"
register: evomaintenance_script
- name: Add evomaintenance trap for '{{ user.name }}'
@ -43,7 +43,7 @@
state: present
dest: '/home/{{ user.name }}/.profile'
insertafter: EOF
line: 'trap "sudo {{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/evomaintenance.sh" 0'
line: 'trap "sudo /usr/share/scripts/evomaintenance.sh" 0'
when: evomaintenance_script.stat.exists
- name: Create .ssh directory for '{{ user.name }}'

View file

@ -1,6 +1,6 @@
Defaults umask=0077
Cmnd_Alias MAINT = {{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/evomaintenance.sh, {{ listupgrade_scripts_dir or general_scripts_dir | mandatory }}/listupgrade.sh, /usr/bin/apt, /bin/mount
Cmnd_Alias MAINT = /usr/share/scripts/evomaintenance.sh, /usr/share/scripts/listupgrade.sh, /usr/bin/apt, /bin/mount
User_Alias ADMINS = {{ user.name }}
nagios ALL = NOPASSWD: /usr/lib/nagios/plugins/check_procs

View file

@ -2,9 +2,6 @@
general_alert_email: "root@localhost"
evomaintenance_alert_email: Null
general_scripts_dir: "/usr/local/bin"
evomaintenance_scripts_dir: Null
evomaintenance_hostname: "{{ ansible_fqdn }}"
evomaintenance_pg_host: Null

View file

@ -6,7 +6,7 @@
- name: install shell trap in {{ home }}/.bash_profile
lineinfile:
dest: "{{ home }}/.bash_profile"
line: "trap \"sudo {{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/evomaintenance.sh\" 0"
line: "trap \"sudo /usr/share/scripts/evomaintenance.sh\" 0"
insertafter: EOF
create: no
when: bash_profile.stat.exists
@ -20,7 +20,7 @@
- name: install shell trap in {{ home }}/.profile
lineinfile:
dest: "{{ home }}/.profile"
line: "trap \"sudo {{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/evomaintenance.sh\" 0"
line: "trap \"sudo /usr/share/scripts/evomaintenance.sh\" 0"
insertafter: EOF
create: yes
when: not bash_profile.stat.exists

View file

@ -1,6 +1,3 @@
---
general_alert_email: "root@localhost"
listupgrade_alert_email: Null
general_scripts_dir: "/usr/local/bin"
listupgrade_scripts_dir: Null

View file

@ -1,14 +1,14 @@
---
- name: Scripts dir is present
file:
path: "{{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}"
path: "/usr/share/scripts"
state: directory
mode: 0700
- name: Copy listupgrade script
template:
src: listupgrade.sh.j2
dest: "{{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/listupgrade.sh"
dest: "/usr/share/scripts/listupgrade.sh"
mode: 0700
owner: root
group: root

View file

@ -1 +1 @@
42 9 * * 2 root {{ listupgrade_scripts_dir or general_scripts_dir | mandatory }}/listupgrade.sh --cron
42 9 * * 2 root /usr/share/scripts/listupgrade.sh --cron