Skip to content

Instantly share code, notes, and snippets.

@jas02
Last active April 24, 2017 12:59
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 jas02/70dd74965ed47bc54e9fcfa1ce5aa471 to your computer and use it in GitHub Desktop.
Save jas02/70dd74965ed47bc54e9fcfa1ce5aa471 to your computer and use it in GitHub Desktop.
{% for slmid, data in pillar.get('rancher-environment', {}).items() %}
{% set api_account_name = data['api_account_name'] %}
{% set rancher_server = data['host'] %}
add_api_key:
cmd.run:
- name: |
curl -s \
-X POST \
-k \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"type":"apikey","accountId":"1a1","name":"{{ api_account_name }}","description":null,"created":null,"kind":null,"removeTime":null,"removed":null,"uuid":null}' \
'https://{{ rancher_server }}/v1/apikey'
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment