This repository was archived by the owner on Jul 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from chbrown13/setup-avahi-discovery
Adding setup-avahi-discovery role
- Loading branch information
Showing
12 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Ansible Role for Setting Up Avahi Discovery | ||
=========================================== | ||
|
||
This Ansible role sets up avahi discovery used to discover VMs deployed to a VLAN. | ||
|
||
Requirements | ||
------------ | ||
|
||
No Requirements are required for this role. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
No variables required for this role. | ||
|
||
Dependencies | ||
------------ | ||
|
||
This role is not dependent upon any galaxy roles. | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
Here is a simple example of an avahi role: | ||
|
||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- avahi | ||
|
||
License | ||
------- | ||
|
||
GNU GENERAL PUBLIC LICENSE | ||
|
||
Version 3, 29 June 2007 | ||
|
||
Copyright (C) 2007 Free Software Foundation, Inc. | ||
|
||
|
||
Author Information | ||
------------------ | ||
|
||
This is developed by Satellite QE team, irc: #robottelo on Freenode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# defaults file for avahi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# handlers file for avahi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
# Standards: 0.2 | ||
galaxy_info: | ||
author: Satellite QE Team | ||
description: Satellite QE Team | ||
company: Red Hat | ||
|
||
license: GPLv3 | ||
|
||
min_ansible_version: 2.5.0 | ||
|
||
platforms: | ||
- name: RHEL | ||
versions: | ||
- 7 | ||
|
||
galaxy_tags: [] | ||
|
||
|
||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: "Add MDNS service" | ||
iptables: | ||
chain: INPUT | ||
destination: 224.0.0.251/32 | ||
protocol: udp | ||
match: udp, conntrack | ||
destination_port: 5353 | ||
ctstate: NEW | ||
jump: ACCEPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: "Enable MDNS service" | ||
firewalld: | ||
service: mdns | ||
permanent: true | ||
state: enabled | ||
|
||
- name: "Reload firewall" | ||
systemd: | ||
name: firewalld | ||
state: reloaded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: "Install epel-release" | ||
package: | ||
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ansible_distribution_major_version}}.noarch.rpm | ||
state: present | ||
|
||
- name: "Install nss-mdns" | ||
package: | ||
name: nss-mdns | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
# tasks file for avahi | ||
- include_tasks: install_mdns.yml | ||
- include_tasks: enable_mdns_service.yml | ||
when: ansible_distribution_major_version >= 7 | ||
- include_tasks: add_mdns_service.yml | ||
when: ansible_distribution_major_version < 7 | ||
- include_tasks: restart_avahi.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: "Restart dbus" | ||
service: | ||
name: dbus | ||
state: restarted | ||
|
||
- name: "Restart Avahi" | ||
service: | ||
name: avahi-daemon | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[sat63] | ||
sat63-rhel7 ansible_ssh_host=sat63-rhel7.example.com ansible_user=root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- hosts: sat63 | ||
roles: | ||
- avahi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# vars file for avahi |