Fix fas_client task to set nsswitch.conf. Add hosts task.

This commit is contained in:
Kevin Fenzi 2013-04-17 21:52:28 +00:00
parent 4f84817cfa
commit 70308db00b
6 changed files with 94 additions and 6 deletions

View file

@ -0,0 +1,45 @@
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#
passwd: db files
shadow: db files
group: db files
#hosts: db files nisplus nis dns
hosts: files dns
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: files
publickey: nisplus
automount: files
aliases: files nisplus

View file

@ -0,0 +1,13 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.5.126.23 infrastructure.fedoraproject.org
10.5.125.63 koji.fedoraproject.org
10.5.125.36 kojipkgs.fedoraproject.org
10.5.126.23 infrastructure.fedoraproject.org
10.5.124.138 arm.koji.fedoraproject.org
10.5.125.44 pkgs.fedoraproject.org pkgs
#
# This is proxy01.phx2.fedoraproject.org
#
10.5.126.52 mirrors.fedoraproject.org
10.5.126.52 admin.fedoraproject.org

View file

@ -2,7 +2,7 @@
- name: Setup arm-qa hosts
hosts: arm-qa
user: root
gather_facts: False
gather_facts: True
tags:
- arm-qa
@ -11,7 +11,9 @@
- ${private}/vars.yml
tasks:
# This group uses fas_client for user management
# This task sets up fas_client for user management
- include: $tasks/fas_client.yml
# This group includes our common scripts
# This task sets up /etc/hosts for us
- include: $tasks/hosts.yml
# This task includes our common scripts
- include: $tasks/common_scripts.yml

View file

@ -2,7 +2,7 @@
- name: Setup arm-releng hosts
hosts: arm-releng
user: root
gather_facts: False
gather_facts: True
tags:
- arm-releng
@ -11,7 +11,9 @@
- ${private}/vars.yml
tasks:
# This group uses fas_client for user management
# This task sets up fas_client for user management
- include: $tasks/fas_client.yml
# This group includes our common scripts
# This task sets up /etc/hosts for us
- include: $tasks/hosts.yml
# This task includes our common scripts
- include: $tasks/common_scripts.yml

View file

@ -22,6 +22,12 @@
tags:
- packages
#
# setup /etc/nsswitch.conf to use nssdb
#
- name: setup /etc/nsswitch.conf for client use
action: copy src=$files/fas-client/nsswitch.conf dest=/etc/nsswitch.conf owner=root mode=644
#
# fasClients needs a valid /etc/fas.conf.
# There's vars used in this template:

20
tasks/hosts.yml Normal file
View file

@ -0,0 +1,20 @@
---
#
# This task sets up /etc/hosts on a machine.
#
# This should only be used in rare cases
#
#
# This will move a /etc/hosts in place if it's setup in files for that host/domain
# Note that if it's not set it will just skip this play and do nothing.
#
- name: setup /etc/hosts for client use
action: copy src=$item dest=/etc/hosts
with_first_found:
- $files/hosts/${ansible_fqdn}-hosts
- $files/hosts/${ansible_hostname}-hosts
- $files/hosts/${ansible_domain}-hosts
skip: true
tags:
- config