Skip to content

Commit

Permalink
Remove hard role dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
drybjed committed Feb 7, 2016
1 parent 35d4741 commit 7a0f45f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ v0.1.0
doesn't want to play nice with both ``systemd`` unit and ``sysvinit`` script
being present. [drybjed]

- Remove hard role dependencies on ``ferm``, ``tcpwrappers`` and APT
preferences. Move their configuration to default variables, which can be used
from an Ansible playbook. [drybjed]

39 changes: 39 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,42 @@ snmpd_account_agent_password: '{{ lookup("password", secret +
"/snmp/credentials/agent/password chars=ascii_letters,digits,hexdigits length=" +
snmpd_account_password_length) }}'


# ----------------------------------------
# Configuration of other Ansible roles
# ----------------------------------------

# .. envvar:: snmpd_apt_preferences_dependent_list
#
# Configuration for ``debops.apt_preferences`` role.
snmpd_apt_preferences_dependent_list:

- package: 'lldpd libbsd0'
backports: [ 'wheezy' ]
reason: 'Version parity with Debian Jessie'
by_role: 'debops.snmpd'


# .. envvar:: snmpd_ferm_dependent_rules
#
# Configuration for ``debops.ferm`` role.
snmpd_ferm_dependent_rules:

- type: 'accept'
protocol: [ 'udp' ]
dport: [ 'snmp' ]
saddr: '{{ snmpd_allow + snmpd_group_allow + snmpd_host_allow + snmpd_local_allow }}'
role: 'snmpd'


# .. envvar:: snmpd_tcpwrappers_dependent_allow
#
# Configuration for ``debops.tcpwrappers`` role.
snmpd_tcpwrappers_dependent_allow:

- daemon: 'snmpd'
client: '{{ snmpd_allow + snmpd_group_allow + snmpd_host_allow + snmpd_local_allow }}'
weight: '50'
filename: 'snmpd_dependency_allow'
comment: 'Allow remote connections to SNMP daemon'

26 changes: 0 additions & 26 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,6 @@ dependencies:

- role: debops.secret

- role: debops.apt_preferences
tags: apt_preferences
apt_preferences_dependent_list:

- package: 'lldpd'
backports: [ 'wheezy' ]
reason: 'Version parity with Debian Jessie'
by_role: 'debops.snmpd'

- role: debops.ferm
ferm_input_dependent_list:

- type: 'dport_accept'
protocol: [ 'udp' ]
dport: [ 'snmp' ]
saddr: '{{ snmpd_allow + snmpd_group_allow + snmpd_host_allow + snmpd_local_allow }}'

- role: debops.tcpwrappers
tcpwrappers_allow:

- daemon: 'snmpd'
client: '{{ snmpd_allow + snmpd_group_allow + snmpd_host_allow + snmpd_local_allow }}'
weight: '50'
filename: 'snmpd_dependency_allow'
comment: 'Allow remote connections to SNMP daemon'

galaxy_info:
author: 'Maciej Delmanowski'
description: 'Install and configure SNMP service'
Expand Down

0 comments on commit 7a0f45f

Please sign in to comment.