Add postfix to bootstrap playbook

It is helpful to enable email services by default, so we can get
notified of issues.

Change-Id: I326c4cdc1cc326904e12338a3ed96b2c59a4cc06
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-04-01 21:45:56 -04:00
parent 216a94bbea
commit c51aed035e
5 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# Copyright 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
# tasks/main.yaml
postfix_task_manager:
- install
- service
postfix_package_name: postfix
postfix_service_postfix_daemon_reload: true
postfix_service_postfix_enabled: true
postfix_service_postfix_manage: true
postfix_service_postfix_name: postfix
postfix_service_postfix_state: started

View File

@ -0,0 +1,19 @@
# Copyright 2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Install postfix from package
become: true
package:
name: "{{ postfix_package_name }}"
state: present

View File

@ -0,0 +1,18 @@
# Copyright 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- include: "{{ postfix_task }}.yaml"
with_items: "{{ postfix_task_manager }}"
loop_control:
loop_var: postfix_task

View File

@ -0,0 +1,33 @@
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Enable postfix service
become: true
systemd:
daemon_reload: "{{ postfix_service_postfix_daemon_reload }}"
enabled: "{{ postfix_service_postfix_enabled }}"
name: "{{ postfix_service_postfix_name }}"
register: postfix_service_postfix
when: postfix_service_postfix_manage
- name: Set postfix service state
become: true
systemd:
daemon_reload: "{{ postfix_service_postfix_daemon_reload }}"
name: "{{ postfix_service_postfix_name }}"
state: "{{ postfix_service_postfix_state }}"
register: postfix_service_postfix_state_info
when:
- postfix_service_postfix_manage
- postfix_service_postfix_state in ['reloaded', 'restarted', 'started', 'stopped']

View File

@ -36,6 +36,10 @@
include_role:
name: swap
- name: Setup postfix role
include_role:
name: postfix
- name: Setup openstack.virtualenv role
include_role:
name: openstack.virtualenv