Skip to content
Snippets Groups Projects
Commit fab0d5d2 authored by nimrod's avatar nimrod
Browse files

- Full role.

parent ef74305b
No related branches found
No related tags found
No related merge requests found
--- ---
# defaults file for transmission # defaults file for transmission
transmission_rss_version: '0.2.4'
...@@ -6,3 +6,19 @@ ...@@ -6,3 +6,19 @@
that: that:
- ansible_pkg_mgr == 'apt' - ansible_pkg_mgr == 'apt'
- ansible_service_mgr == 'systemd' - ansible_service_mgr == 'systemd'
- name: APT install
apt:
name: transmission-daemon
state: present
update_cache: True
cache_valid_time: 3600
- name: Enable service
service:
name: transmission-daemon
state: started
enabled: True
- include: transmission-rss.yml
when: transmission_rss_config is defined
---
# tasks file for transmission-rss
- name: APT install transmission-rss pre-requisites
apt:
name: ruby-rb-inotify
state: present
update_cache: True
cache_valid_time: 3600
- name: Gem install transmission-rss
gem:
name: transmission-rss
version: '{{ transmission_rss_version }}'
state: present
- name: Configure transmission-rss
copy:
content: '{{ transmission_rss_config|to_nice_yaml }}'
dest: /etc/transmission-rss.conf
owner: root
group: root
mode: 0o0644
- name: Add transmission-rss service
template:
src: transmission-rss.service.j2
dest: /etc/systemd/system/transmission-rss.service
owner: root
group: root
mode: 0o0644
- name: Enable transmission-rss service
service:
name: transmission-rss
state: started
enabled: True
[Unit]
Description=Transmission RSS daemon.
After=network.target transmission-daemon.service
[Service]
Type=simple
ExecStart=/usr/local/bin/transmission-rss
ExecReload=/bin/kill -s HUP $MAINPID
User=debian-transmission
Restart=always
[Install]
WantedBy=multi-user.target
...@@ -20,3 +20,6 @@ ...@@ -20,3 +20,6 @@
- hosts: all - hosts: all
roles: roles:
- role: transmission - role: transmission
transmission_rss_config:
feeds:
seen_file: ~/.config/transmission/seen
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all')
def test_transmission(host):
service = host.service('transmission-daemon')
assert service.is_running
assert service.is_enabled
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all')
def test_transmission_rss(host):
service = host.service('transmission-rss')
assert service.is_running
assert service.is_enabled
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment