From f087f165f3256990a219b66730b35c42d4dd594d Mon Sep 17 00:00:00 2001 From: maschinetheist Date: Sat, 12 Sep 2015 16:22:42 -0500 Subject: [PATCH] Added ability to specify room number, home phone, and work phone as per https://docs.saltstack.com/en/develop/ref/states/all/salt.states.user.html --- pillar.example | 3 +++ users/init.sls | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/pillar.example b/pillar.example index 1d9cc97..b970e46 100644 --- a/pillar.example +++ b/pillar.example @@ -10,6 +10,9 @@ users: enforce_password: True home: /custom/buser createhome: True + roomnumber: "A-1" + workphone: "(555) 555-5555" + homephone: "(555) 555-5551" manage_vimrc: False manage_bashrc: False manage_profile: False diff --git a/users/init.sls b/users/init.sls index 28898e2..fc65292 100644 --- a/users/init.sls +++ b/users/init.sls @@ -95,6 +95,15 @@ users_{{ name }}_user: {% if 'fullname' in user %} - fullname: {{ user['fullname'] }} {% endif -%} + {% if 'roomnumber' in user %} + - roomnumber: {{ user['roomnumber'] }} + {% endif %} + {% if 'workphone' in user %} + - workphone: {{ user['workphone'] }} + {% endif %} + {% if 'homephone' in user %} + - homephone: {{ user['workphone'] }} + {% endif %} {% if not user.get('createhome', True) %} - createhome: False {% endif %}