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' password_hash: 'gsdfgsdfgsdfgsdf'
ssh_key: 'ssh-rsa QWERTYUIOP' 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: [] 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? - name: is evomaintenance installed?
stat: stat:
path: "{{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/evomaintenance.sh" path: "/usr/share/scripts/evomaintenance.sh"
register: evomaintenance_script register: evomaintenance_script
- name: Add evomaintenance trap for '{{ user.name }}' - name: Add evomaintenance trap for '{{ user.name }}'
@ -43,7 +43,7 @@
state: present state: present
dest: '/home/{{ user.name }}/.profile' dest: '/home/{{ user.name }}/.profile'
insertafter: EOF 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 when: evomaintenance_script.stat.exists
- name: Create .ssh directory for '{{ user.name }}' - name: Create .ssh directory for '{{ user.name }}'

View File

@ -1,6 +1,6 @@
Defaults umask=0077 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 }} User_Alias ADMINS = {{ user.name }}
nagios ALL = NOPASSWD: /usr/lib/nagios/plugins/check_procs nagios ALL = NOPASSWD: /usr/lib/nagios/plugins/check_procs

View File

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

View File

@ -6,7 +6,7 @@
- name: install shell trap in {{ home }}/.bash_profile - name: install shell trap in {{ home }}/.bash_profile
lineinfile: lineinfile:
dest: "{{ home }}/.bash_profile" 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 insertafter: EOF
create: no create: no
when: bash_profile.stat.exists when: bash_profile.stat.exists
@ -20,7 +20,7 @@
- name: install shell trap in {{ home }}/.profile - name: install shell trap in {{ home }}/.profile
lineinfile: lineinfile:
dest: "{{ home }}/.profile" 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 insertafter: EOF
create: yes create: yes
when: not bash_profile.stat.exists when: not bash_profile.stat.exists

View File

@ -1,6 +1,3 @@
--- ---
general_alert_email: "root@localhost" general_alert_email: "root@localhost"
listupgrade_alert_email: Null 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 - name: Scripts dir is present
file: file:
path: "{{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}" path: "/usr/share/scripts"
state: directory state: directory
mode: 0700 mode: 0700
- name: Copy listupgrade script - name: Copy listupgrade script
template: template:
src: listupgrade.sh.j2 src: listupgrade.sh.j2
dest: "{{ evomaintenance_scripts_dir or general_scripts_dir | mandatory }}/listupgrade.sh" dest: "/usr/share/scripts/listupgrade.sh"
mode: 0700 mode: 0700
owner: root owner: root
group: 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