Browse Source

postfix: split test specific playbook out

keep-around/441bb62798e1d13de9e6fa259e2b013ebcc09baf
Loïc Dachary 4 years ago
parent
commit
1395feb984
  1. 1
      .gitignore
  2. 91
      molecule/postfix/playbook.yml
  3. 40
      molecule/postfix/postfix-playbook.yml
  4. 42
      molecule/postfix/test-postfix-client-playbook.yml

1
.gitignore

@ -5,3 +5,4 @@
__pycache__
.cache
openrc.sh
pytestdebug.log

91
molecule/postfix/playbook.yml

@ -1,90 +1,3 @@
---
- name: install postfix
hosts: [ 'debops_service_postfix' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: debops.etc_aliases/env
tags: [ 'role::etc_aliases', 'role::secret', 'role::postfix' ]
- role: debops.postfix/env
tags: [ 'role::postfix', 'role::secret', 'role::ferm' ]
- role: debops.secret
tags: [ 'role::secret', 'role::postfix' ]
secret__directories:
- '{{ etc_aliases__secret__directories }}'
- '{{ postfix__secret__directories }}'
- role: debops.ferm
tags: [ 'role::ferm' ]
ferm__dependent_rules:
- '{{ postfix__ferm__dependent_rules }}'
- role: debops.etc_aliases
tags: [ 'role::etc_aliases' ]
- role: debops.postfix
postfix__mastercf:
- name: 'smtps'
state: 'present'
options:
- smtpd_sasl_auth_enable: False
- name: 'smtpd_relay_restrictions'
state: 'comment'
postfix__maincf:
- name: 'smtpd_relay_restrictions'
state: 'absent'
- name: 'mynetworks'
value:
- name: '0.0.0.0/0'
postfix__restrictions_maincf: []
tags: [ 'role::postfix' ]
- name: install postfix client
hosts: [ 'debops_service_postfix_client' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: debops.etc_aliases/env
tags: [ 'role::etc_aliases', 'role::secret', 'role::postfix' ]
- role: debops.postfix/env
tags: [ 'role::postfix', 'role::secret', 'role::ferm' ]
- role: debops.secret
tags: [ 'role::secret', 'role::postfix' ]
secret__directories:
- '{{ etc_aliases__secret__directories }}'
- '{{ postfix__secret__directories }}'
- role: debops.ferm
tags: [ 'role::ferm' ]
ferm__dependent_rules:
- '{{ postfix__ferm__dependent_rules }}'
- role: debops.etc_aliases
tags: [ 'role::etc_aliases' ]
- role: debops.postfix
postfix__relayhost: '[{{ hostvars["postfix"]["ansible_default_ipv4"]["address"] }}]:465'
postfix__maincf:
- name: 'smtp_tls_security_level'
value: 'encrypt'
section: 'smtp-tls'
- name: 'smtp_tls_wrappermode'
value: 'yes'
section: 'smtp-tls'
tags: [ 'role::postfix' ]
- include: postfix-playbook.yml
- include: test-postfix-client-playbook.yml

40
molecule/postfix/postfix-playbook.yml

@ -0,0 +1,40 @@
---
- name: install postfix
hosts: [ 'debops_service_postfix' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: debops.etc_aliases/env
- role: debops.postfix/env
- role: debops.secret
secret__directories:
- '{{ etc_aliases__secret__directories }}'
- '{{ postfix__secret__directories }}'
- role: debops.ferm
ferm__dependent_rules:
- '{{ postfix__ferm__dependent_rules }}'
- role: debops.etc_aliases
- role: debops.postfix
postfix__mastercf:
- name: 'smtps'
state: 'present'
options:
- smtpd_sasl_auth_enable: False
- name: 'smtpd_relay_restrictions'
state: 'comment'
postfix__maincf:
- name: 'smtpd_relay_restrictions'
state: 'absent'
- name: 'mynetworks'
value:
- name: '0.0.0.0/0'
postfix__restrictions_maincf: []

42
molecule/postfix/test-postfix-client-playbook.yml

@ -0,0 +1,42 @@
---
- name: install postfix client
hosts: [ 'debops_service_postfix_client' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: debops.etc_aliases/env
tags: [ 'role::etc_aliases', 'role::secret', 'role::postfix' ]
- role: debops.postfix/env
tags: [ 'role::postfix', 'role::secret', 'role::ferm' ]
- role: debops.secret
tags: [ 'role::secret', 'role::postfix' ]
secret__directories:
- '{{ etc_aliases__secret__directories }}'
- '{{ postfix__secret__directories }}'
- role: debops.ferm
tags: [ 'role::ferm' ]
ferm__dependent_rules:
- '{{ postfix__ferm__dependent_rules }}'
- role: debops.etc_aliases
tags: [ 'role::etc_aliases' ]
- role: debops.postfix
postfix__relayhost: '[{{ hostvars["postfix"]["ansible_default_ipv4"]["address"] }}]:465'
postfix__maincf:
- name: 'smtp_tls_security_level'
value: 'encrypt'
section: 'smtp-tls'
- name: 'smtp_tls_wrappermode'
value: 'yes'
section: 'smtp-tls'
tags: [ 'role::postfix' ]
Loading…
Cancel
Save