You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

70 lines
1.6 KiB

---
- name: test for previous install
find:
paths: "{{ freshrss_dir }}"
pattern: index.html
register: previous_install
- set_fact:
skip_install: "{{ previous_install.matched == 1 }}"
- name: download freshrss tarball
get_url:
url: "{{ freshrss_url }}"
dest: /tmp/
when: not skip_install
- name: unarchive file
unarchive:
remote_src: yes
src: "{{ freshrss_tar }}"
dest: /tmp
owner: "{{ lighttpd_user }}"
group: "{{ lighttpd_group }}"
when: not skip_install
- name: copy files to docroot
copy:
remote_src: yes
src: "/tmp/FreshRSS-{{ freshrss_version }}/"
dest: "{{ docroot }}/freshrss/"
owner: "{{ lighttpd_user }}"
group: "{{ lighttpd_group }}"
when: not skip_install
- name: reset docroot to freshrss/p
lineinfile:
path: /etc/lighttpd/lighttpd.conf
regexp: '^server.document-root'
line: server.document-root = "{{ freshrss_dir }}/p"
when: not skip_install
- name: restart lighttpd
service:
name: lighttpd
state: restarted
when: not skip_install
#
# install backup data
#
- name: test for backup guard
find:
path: "{{ freshrss_dir }}"
pattern: "{{ backup_guard }}"
register: backup_guard_present
- name: extract backup data
unarchive:
src: "{{ backup_archive }}"
dest: "{{ freshrss_dir }}"
owner: "{{ lighttpd_user }}"
group: "{{ lighttpd_group }}"
when: use_backup and backup_guard_present.matched == 0
- name: add guard file to let ansible know backup is completed
file:
path: "{{ freshrss_dir }}/{{ backup_guard }}"
state: touch
when: use_backup and backup_guard_present.matched == 0