Re: [PATCH] Add defaults var for fas_client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Thu, Dec 3, 2015 at 11:17 PM Nicolas Chauvet <kwizart@xxxxxxxxx> wrote:
v3: avoid to use env == "staging"
v2: fix inverted fas_staging_url/fas_url
---
 inventory/group_vars/all               |    3 +++
 inventory/group_vars/staging           |    2 ++
 roles/fas_client/defaults/main.yml     |    7 +++++++
 roles/fas_client/templates/fas.conf.j2 |   10 +++-------
 4 files changed, 15 insertions(+), 7 deletions(-)
 create mode 100644 roles/fas_client/defaults/main.yml

diff --git a/inventory/group_vars/all b/inventory/group_vars/all
index feff99f..6855f3f 100644
--- a/inventory/group_vars/all
+++ b/inventory/group_vars/all
@@ -49,6 +49,9 @@ virt_install_command: virt-install -n {{ inventory_hostname }} -r {{ mem_size }}
 # the staging group and is used in the proxies.yml playbook.
 wildcard_cert_name: wildcard-2014.fedoraproject.org

+# Default fas url
+fas_url: https://admin.fedoraproject.org/accounts/
+
 # By default, nodes get no fedmsg certs.  They need to declare them explicitly.
 fedmsg_certs: []

diff --git a/inventory/group_vars/staging b/inventory/group_vars/staging
index f083e2b..76e4790 100644
--- a/inventory/group_vars/staging
+++ b/inventory/group_vars/staging
@@ -10,6 +10,8 @@ wildcard_cert_name: wildcard-2014.stg.fedoraproject.org
 # This only does anything if the host is not RHEL6
 collectd_graphite: True

+fas_url: https://admin.stg.fedoraproject.org/accounts/
+
 fedmsg_prefix: org.fedoraproject
 fedmsg_env: stg

diff --git a/roles/fas_client/defaults/main.yml b/roles/fas_client/defaults/main.yml
new file mode 100644
index 0000000..345e1e4
--- /dev/null
+++ b/roles/fas_client/defaults/main.yml
@@ -0,0 +1,7 @@
+---
+# defaults file for fas_client
+#
+
+fas_url: https://admin.fedoraproject.org/accounts/
+fas_home: /home/fedora
+fas_home_backup_dir: "{{ fas_home }}.bak"
diff --git a/roles/fas_client/templates/fas.conf.j2 b/roles/fas_client/templates/fas.conf.j2
index a27f0ef..3e6f8f3 100644
--- a/roles/fas_client/templates/fas.conf.j2
+++ b/roles/fas_client/templates/fas.conf.j2
@@ -1,10 +1,6 @@
 [global]
 ; url - Location to fas server
-{% if env == "staging" %}
-url = "" href="https://admin.stg.fedoraproject.org/accounts/" rel="noreferrer" target="_blank">https://admin.stg.fedoraproject.org/accounts/
-{% else %}
-url = "" href="https://admin.fedoraproject.org/accounts/" rel="noreferrer" target="_blank">https://admin.fedoraproject.org/accounts/
-{% endif %}
+url = "" fas_url  }}

 ; temp - Location to generate files while user creation process is happening
 temp = /var/db
@@ -59,11 +55,11 @@ aliases_template = /etc/aliases.template
 shell = /bin/bash

 ; home - the location for fas user home dirs
-home = /home/fedora
+home = {{ fas_home  }}

 ; home_backup_dir - Location home dirs should get moved to when a user is
 ; deleted this location should be tmpwatched
-home_backup_dir = /home/fedora.bak
+home_backup_dir = {{ fas_home_backup_dir  }}

 ; ssh_restricted_app - This is the path to the restricted shell script.  It
 ; will not work automatically for most people though through alterations it
--
1.7.2.1

Excellent, +1 from me. 
--

Xavier

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux