Skip to content

Instantly share code, notes, and snippets.

@mjinks
Last active August 25, 2015 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjinks/9df440d5042dd67d4977 to your computer and use it in GitHub Desktop.
Save mjinks/9df440d5042dd67d4977 to your computer and use it in GitHub Desktop.
$ sudo salt 'ftp*' state.sls users test=True
[...]
----------
ID: ATTFiles_user
Function: file.directory
Name: /FTPDATA/PRLSS/Customers/ATTFiles
Result: None
Comment: The following files will be changed:
/FTPDATA/PRLSS/Customers/ATTFiles: mode - 0570 <- this is right
Started: 16:07:45.827483
Duration: 0.503 ms
Changes:
----------
[...]
----------
ID: uscc_user
Function: file.directory
Name: /FTPDATA/PRLSS/Customers/USCC
Result: None
Comment: The following files will be changed:
/FTPDATA/PRLSS/Customers/USCC: mode - 0570 <- this is wrong
Started: 16:07:46.343900
Duration: 0.538 ms
Changes:
----------
$ sudo salt 'ftp*' pillar.get users:uscc:chroot
ftp01.chi5.prlss.int:
False
$ sudo salt 'ftp*' pillar.get users:ATTFiles:chroot
ftp01.chi5.prlss.int:
True
ATTFiles:
uid: 5401
prime_group:
name: ATTFiles
gid: 5401
fullname: ATT Files EMI Access
home: /FTPDATA/PRLSS/Customers/ATTFiles
ftpuser: True
createhome: True
chroot: True
shell: /bin/sh
uscc:
uid: 5412
prime_group:
name: uscc
gid: 5412
fullname: USCC EMI Access
home: /FTPDATA/PRLSS/Customers/USCC
ftpuser: True
createhome: True
chroot: False
shell: /bin/sh
{{ name }}_user:
{% if user.get('createhome', True) %}
file.directory:
- name: {{ home }}
- user: {{ name }}
- group: 'tmsadmin'
{% if user.get('chroot'), True %}
- mode: {{ user.get('user_dir_mode', '0570') }}
{% else %}
- mode: {{ user.get('user_dir_mode', '0770') }}
{% endif %}
- require:
- user: {{ name }}
- group: {{ user_group }}
{%- endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment