1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/usb-lib/tasks/main.yml

68 lines
2.1 KiB
YAML
Raw Normal View History

2017-05-27 18:09:50 +00:00
- name: Add a content directory for links to be located
file: dest={{ doc_root }}/local_content
state=directory
owner={{ apache_user }}
group={{ iiab_admin_user }}
2017-05-27 18:09:50 +00:00
mode=0775
- name: Copy mount file to usbmount when enabled
template: src=mount.d/70-usb-library
dest=/etc/usbmount/mount.d/
owner=root
group=root
mode=0751
when: usb_lib_enabled
- name: Copy umount file to usbmount when enabled
template: src=umount.d/70-usb-library
dest=/etc/usbmount/umount.d
owner=root
group=root
mode=0751
when: usb_lib_enabled
- name: Remove mount file to usbmount when not enabled
file: path=/etc/usbmount/mount.d/70-usb-library
state=absent
when: not usb_lib_enabled
- name: Remove umount file to usbmount when not enabled
file: path=/etc/usbmount/umount.d/70-usb-library
state=absent
when: not usb_lib_enabled
- name: Add apache config for content directory
template: src=content_dir.conf
dest=/etc/{{ apache_config_dir }}
when: usb_lib_enabled
- name: create the link to enable for debian
file: src=/etc/{{ apache_config_dir }}/content_dir.conf
dest=/etc/apache2/sites-enabled/content_dir.conf
state=link
2017-05-27 23:10:45 +00:00
when: is_debuntu
2017-05-27 18:09:50 +00:00
- name: remove the link that enables in debian
file: src=/etc/{{ apache_config_dir }}/content_dir.conf
dest=/etc/apache2/sites-enabled/content_dir.conf
state=absent
2017-05-27 23:10:45 +00:00
when: is_debuntu and not usb_lib_enabled
2017-05-27 18:09:50 +00:00
- name: remove apache config for content directory
file: name=/etc/{{ apache_config_dir }}/content_dir.conf
state=absent
when: not usb_lib_enabled
- name: Add usb-lib to service list
ini_file: dest='{{ service_filelist }}'
section=usb-lib
option='{{ item.option }}'
value='{{ item.value }}'
with_items:
- option: name
value: usb-lib
- option: description
value: '"usb-lib automounts a usb drive with and links to library content."'
- option: enabled
value: "{{ usb_lib_enabled }}"