commit c21a6790f25f081a65f1fe4be24394c00fb64f7d
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Mon Feb 5 22:01:13 2018 +0100
Sync fas_client
roles/fas_client/tasks/main.yml | 34 ++++++++++++++++------------------
1 files changed, 16 insertions(+), 18 deletions(-)
---
diff --git a/roles/fas_client/tasks/main.yml b/roles/fas_client/tasks/main.yml
index 1de9f37..b1f17fa 100644
--- a/roles/fas_client/tasks/main.yml
+++ b/roles/fas_client/tasks/main.yml
@@ -1,18 +1,17 @@
---
#
-# This task sets up fasClient on a machine.
+# This task sets up fasClient on a machine.
# It installs the fas-clients package, then the /etc/fas.conf and finally a cron job
update.
#
#
-# fas-clients is in the infrastructure repo.
+# fas-clients is in the infrastructure repo.
# nss_db is needed to store user/group info.
#
- name: install package needed for fas-client (yum)
package: state=present name={{ item }}
with_items:
- fas-clients
- - python-bunch
- cronie
tags:
- packages
@@ -24,14 +23,14 @@
src={{files}}/hotfix/python-fedora/fas2.py
dest="{{pythonsitelib}}/fedora/client/fas2.py"
owner=root group=root mode=0644
+ when: inventory_hostname.startswith('DISABLED')
tags:
- packages
- fas_client
-- name: install nss_db on rhel hosts only
- yum: state=present name=nss_db
- when: (ansible_distribution == "CentOS" and
ansible_distribution_major_version|int >= 6) or
- (ansible_distribution == "Fedora" and
ansible_distribution_major_version|int >= 24)
+- name: install nss_db on rhel or fedora 25 or greater hosts only
+ package: state=present name=nss_db
+ when: ansible_distribution_major_version|int == 6 or
ansible_distribution_major_version|int > 24
tags:
- packages
- fas_client
@@ -40,30 +39,29 @@
# setup /etc/nsswitch.conf to use nssdb
#
- name: setup /etc/nsswitch.conf for client use
- copy: src=nsswitch.conf dest=/etc/nsswitch.conf owner=root mode=644
+ copy: src=nsswitch.conf dest=/etc/nsswitch.conf owner=root mode=0644
tags:
- config
- fas_client
#
-# fasClients needs a valid /etc/fas.conf.
-# There's vars used in this template:
+# fasClients needs a valid /etc/fas.conf.
+# There's vars used in this template:
#
# fas_client_groups = "sysadmin-main"
# fas_client_restricted_app = ""
# fas_client_admin_app = ""
# fas_client_ssh_groups = ""
#
-# if desired, set them on a per host/group basis.
+# if desired, set them on a per host/group basis.
#
-# Currently the default template is used, but could be modified on a host basis.
+# Currently the default template is used, but could be modified on a host basis.
#
- name: setup /etc/fas.conf for client use
- template: src={{ item }} dest=/etc/fas.conf owner=root mode=600
+ template: src={{ item }} dest=/etc/fas.conf owner=root mode=0600
with_first_found:
- - ../templates/{{ ansible_fqdn }}.fas.conf.j2
+ - ../templates/{{ inventory_hostname }}.fas.conf.j2
- ../templates/{{ ansible_hostname }}.fas.conf.j2
- - ../templates/{{ ansible_hostname }}.fas.conf.j2
- ../templates/fas.conf.j2
tags:
- config
@@ -81,20 +79,20 @@
# - config
- name: fas_client cron job
- copy: src=fas-client.cron dest=/etc/cron.d/fas-client owner=root mode=644
+ copy: src=fas-client.cron dest=/etc/cron.d/fas-client owner=root mode=0644
tags:
- config
- fas_client
- name: fas_client_aliases cron job
- copy: src=fas-client-aliases.cron dest=/etc/cron.d/fas-client-aliases owner=root
mode=644
+ copy: src=fas-client-aliases.cron dest=/etc/cron.d/fas-client-aliases owner=root
mode=0644
tags:
- config
- fas_client
when: fas_aliases is defined
- name: fas_client_aliases template
- copy: src={{ files }}/aliases.template dest=/etc/aliases.template owner=root mode=644
+ copy: src=aliases.template dest=/etc/aliases.template owner=root mode=0644
tags:
- config
- fas_client
Show replies by date