Re: [PATCH] Add defaults var for fas_client

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

 



2015-12-03 10:31 GMT+01:00 SmootherFrOgZ <lxtnow@xxxxxxxxx>:
On Thu, Dec 3, 2015 at 10:09 AM Nicolas Chauvet <kwizart@xxxxxxxxx> wrote:
---
 roles/fas_client/defaults/main.yml     |    8 ++++++++
 roles/fas_client/templates/fas.conf.j2 |    8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
 create mode 100644 roles/fas_client/defaults/main.yml

diff --git a/roles/fas_client/defaults/main.yml b/roles/fas_client/defaults/main.yml
new file mode 100644
index 0000000..f0983d2
--- /dev/null
+++ b/roles/fas_client/defaults/main.yml
@@ -0,0 +1,8 @@
+---
+# defaults file for fas_client
+#
+
+fas_url: https://admin.fedoraproject.org/accounts/
+fas_staging_url: https://admin.stg.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..995c8e1 100644
--- a/roles/fas_client/templates/fas.conf.j2
+++ b/roles/fas_client/templates/fas.conf.j2
@@ -1,9 +1,9 @@
 [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/
+url = "" fas_url  }}
 {% else %}
-url = "" href="https://admin.fedoraproject.org/accounts/" rel="noreferrer" target="_blank">https://admin.fedoraproject.org/accounts/
+url = "" fas_staging_url  }}
 {% endif %}

The role should be as generic as possible and not try to deal with system environment if there's no clear/specific behavior tied to this defined environment.
Thus, here we should just have: 
```url = "" fas_url }}```

and deal with the env in the playbook, groups_host or hosts.
Fixing to follow your suggestion with v3.

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

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

 
How about: {{ fas_home_dir }} - which is more explicit?
There is various way to forge arbitrary variable names. I expect that using fas_home constructed after the home variable of the fas.conf file would make it less arbitrary.

 
 ; 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  }}

+1
 
--

Xavier


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




--
-

Nicolas (kwizart)
_______________________________________________
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