Skip to content

Instantly share code, notes, and snippets.

@0xf10e
Created January 28, 2016 11:47
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 0xf10e/d19f5c2a758d5669e731 to your computer and use it in GitHub Desktop.
Save 0xf10e/d19f5c2a758d5669e731 to your computer and use it in GitHub Desktop.
using pillar.get in state files broken in 2015.8 on Ubuntu?
user@workstation:/srv/salt/formulas/openstack-formula.git% sudo salt controller pillar.get 'openstack:skip_pillar_check'
controller:
True
user@workstation:/srv/salt/formulas/openstack-formula.git% head nova/nova_conf.sls
{% from 'openstack/defaults.jinja' import openstack_defaults %}
{% from 'nova/map.jinja' import nova with context %}
{% if not pillar.get('openstack:skip_pillar_check', False) %}
nova passwords in pillar:
test.check_pillar:
- failhard: True
- verbose: {{ salt['pillar.get']('nova:verbose', False) or
salt['pillar.get']('nova:debug:', False) }}
- string:
openstack:
- 'nova:database:password'
user@workstation:/srv/salt/formulas/openstack-formula.git% sudo salt controller state.sls nova.controller saltenv=openstack
controller:
----------
ID: /var/lib/nova/nova.sqlite
Function: file.absent
Result: True
Comment: File /var/lib/nova/nova.sqlite is not present
Started: 12:42:10.680779
Duration: 0.951 ms
Changes:
----------
ID: nova passwords in pillar
Function: test.check_pillar
Result: False
Comment: Pillar key "nova:database:password" is missing.
Pillar key "nova:keystone_authtoken:admin_password" is missing.
Started: 12:42:10.686621
Duration: 1.322 ms
Changes:
Summary
------------
Succeeded: 1
Failed: 1
------------
Total states run: 2
user@workstation:/srv/salt/formulas/openstack-formula.git% sudo salt controller saltutil.refresh_pillar
controller:
False
user@workstation:/srv/salt/formulas/openstack-formula.git% sudo salt controller state.sls nova.controller saltenv=openstack
{% from 'openstack/defaults.jinja' import openstack_defaults %}
controller:
----------
ID: /var/lib/nova/nova.sqlite
Function: file.absent
Result: True
Comment: File /var/lib/nova/nova.sqlite is not present
Started: 12:42:51.163478
Duration: 0.697 ms
Changes:
----------
ID: nova passwords in pillar
Function: test.check_pillar
Result: False
Comment: Pillar key "nova:database:password" is missing.
Pillar key "nova:keystone_authtoken:admin_password" is missing.
Started: 12:42:51.170138
Duration: 0.997 ms
Changes:
Summary
------------
Succeeded: 1
Failed: 1
------------
Total states run: 2
user@workstation:/srv/salt/formulas/openstack-formula.git%
user@workstation:/srv/salt/formulas/openstack-formula.git% vim nova/nova_conf.sls
user@workstation:/srv/salt/formulas/openstack-formula.git% head nova/nova_conf.sls
{% from 'openstack/defaults.jinja' import openstack_defaults %}
{% from 'nova/map.jinja' import nova with context %}
{# if not pillar.get('openstack:skip_pillar_check', False) #}
{% if pillar.get('openstack:skip_pillar_check', False) %}
nova passwords in pillar:
test.check_pillar:
- failhard: True
- verbose: {{ salt['pillar.get']('nova:verbose', False) or
salt['pillar.get']('nova:debug:', False) }}
- string:
user@workstation:/srv/salt/formulas/openstack-formula.git% sudo salt controller pillar.get 'openstack:skip_pillar_check'
controller:
False
user@workstation:/srv/salt/formulas/openstack-formula.git% sudo salt controller state.sls nova.controller saltenv=openstack
controller:
----------
ID: /var/lib/nova/nova.sqlite
Function: file.absent
Result: True
Comment: File /var/lib/nova/nova.sqlite is not present
Started: 12:43:34.367874
Duration: 1.6 ms
Changes:
----------
ID: nova-db
openstack:
Function: mysql_database.present
Name: nova
Result: False
Comment: The following requisites were not found:
require:
test: nova passwords in pillar
Started:
Duration:
Changes:
----------
ID: nova-dbuser
Function: mysql_user.present
Name: nova
Result: False
Comment: The following requisites were not found:
require:
test: nova passwords in pillar
Started:
Duration:
Changes:
Summary
------------
Succeeded: 1
Function: mysql_database.present
Name: nova
Result: False
Comment: The following requisites were not found:
require:
test: nova passwords in pillar
Started:
Duration:
Changes:
----------
ID: nova-dbuser
Function: mysql_user.present
Name: nova
Result: False
Comment: The following requisites were not found:
require:
test: nova passwords in pillar
Started:
Duration:
Changes:
Summary
------------
Succeeded: 1
Failed: 2
------------
Total states run: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment