Skip to content

Instantly share code, notes, and snippets.

@proffalken
Created May 24, 2018 06:33
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 proffalken/0e23da4d1e94ac338055bf4a69784a2b to your computer and use it in GitHub Desktop.
Save proffalken/0e23da4d1e94ac338055bf4a69784a2b to your computer and use it in GitHub Desktop.
Ansible issues

Hey folks, Ansible is messing me around. I've got a load of nested defaults that are setup in <role>/defaults/main.yml as follows:

aaa:
  accounts:
    min_uid: 1000
    max_uid: 60000
    min_system_uid: 500
    max_system_uid: 999
    encryption_method: SHA512
  console:
    consoles: '/etc/console'
    su_path:  'PATH=/usr/local/sbin:/usr/local/bin:/usr/bin'
    env_path: 'PATH=/usr/local/sbin:/usr/local/bin:/usr/bin'
    tty_group: tty
    tty_perm:  0600
    erase_character: 0117
    kill_character:  025
    umask: 0027
    motd_path: '/etc/motd'

and I'm using them in a template like this:

## Login Defaults

#### Account-related Settings
UID_MIN			    {{ aaa.accounts.min_uid }}
UID_MAX			    {{ aaa.accounts.max_uid }}
SYS_UID_MIN		    {{ aaa.accounts.min_system_uid }}
SYS_UID_MAX		    {{ aaa.accounts.max_system_uid }}
ENCRYPT_METHOD	    {{ aaa.accounts.encryption_method }}

#### Console-related Settings
CONSOLE             {{ aaa.console.consoles }} 
ENV_SUPATH          {{ aaa.console.su_path }}
ENV_PATH            {{ aaa.console.env_path }}
TTYGROUP            {{ aaa.console.tty_group }}
TTYPERM             {{ aaa.console.tty_perm }}
ERASECHAR           {{ aaa.console.erase_character }}
KILLCHAR            {{ aaa.console.kill_character }}
UMASK               {{ aaa.console.umask }}
MOTD_FILE           {{ aaa.console.motd_path }}

but the numbers are rendering differently:

#### Account-related Settings
UID_MIN                     1000
UID_MAX                     60000
SYS_UID_MIN                 500
SYS_UID_MAX                 999
ENCRYPT_METHOD      SHA512

#### Console-related Settings
CONSOLE             /etc/console
ENV_SUPATH          PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
ENV_PATH            PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
TTYGROUP            tty
TTYPERM             384 # this is not the number I was expecting
ERASECHAR           79  # neither is this
KILLCHAR            21 # nor this
UMASK               23   # or this...
MOTD_FILE           /etc/motd

Weirdly, it's not all the numbers, just some of them, has anyone seen this before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment