1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/calibre/tasks/main.yml
georgejhunt 30f4dfc1af Notags (#73)
* bulk change use_cache/no_network->internet_available

* bulk change use_cache/no_network->internet_available

* remove unuseful debug statements

* remove download tags

* appendix has_internet_connection

* ubuntu dhcpd needs to connect to br0
2017-06-29 10:48:41 -07:00

70 lines
2.1 KiB
YAML

- name: Get calibre setup file
# the installer works for intel fedora, and Centos, and deals with dependencies
get_url:
url="{{ calibre_src_url }}"
dest="{{ downloads_dir }}/calibre-installer.py"
mode=0755
when: ansible_distribution == "CentOS"
- name: Install calibre
shell: "{{ downloads_dir }}/calibre-installer.py >> /dev/null"
args:
creates: /usr/bin/calibre-uninstall
when: calibre_install and ansible_distribution == 'CentOS'
- name: Install Caibre rpms
# the fedora rpm arm version, though older, takes care of dependencies, and exists
package: name={{ item }}
state=present
with_items:
- calibre
when: calibre_install and ansible_distribution != 'CentOS'
- name: Create calibre service(s) and support scripts
template: backup=no
src={{ item.src }}
dest={{ item.dest }}
owner=root
group=root
mode={{ item.mode }}
with_items:
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
when: calibre_install
- name: Create the link for sites-enabled
file: src=/etc/apache2/sites-available/calibre.conf
dest=/etc/apache2/sites-enabled/calibre.conf
state=link
when: is_debuntu and calibre_enabled
- name: Enable Calibre server
service: name=calibre-serve
enabled=yes
state=started
#async: 900
#poll: 5
when: calibre_enabled
- name: Disable Calibre server
service: name=calibre-serve
enabled=no
state=stopped
when: not calibre_enabled
- name: Add calibre to service list
ini_file: dest='{{ service_filelist }}'
section=calibre
option='{{ item.option }}'
value='{{ item.value }}'
with_items:
- option: description
value: '"Calibre epub book server"'
- option: url
value: "{{ calibre_src_url }}"
- option: database
value: "{{ calibre_dbpath }}"
- option: port
value: "{{ calibre_port }}"
- option: enabled
value: "{{ calibre_enabled }}"