Skip to content

Commit

Permalink
Merge pull request CentOS-PaaS-SIG#280 from herlo/develop
Browse files Browse the repository at this point in the history
Make a default path for credentials
  • Loading branch information
herlo committed Jun 12, 2017
2 parents 6365a4a + 11741bb commit 5697909
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion linchpin/cli/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def load_config(self, lpconfig=None):
* $PWD/linchpin.conf
* ~/.linchpin.conf
* /etc/linchpin.conf
* linchpin/library/path/linchpin.conf
* /linchpin/library/path/linchpin.conf
Alternatively, a full path to the linchpin configuration file
can be passed.
Expand Down
5 changes: 4 additions & 1 deletion linchpin/linchpin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ default_inventories_path = {{ lp_path }}/defaults/%(inventories_folder)s
schema_v3 = %(default_schemas_path)s/schema_v3.json
schema_v4 = %(default_schemas_path)s/schema_v4.json

# default credentials data, this path doesn't automatically exist
default_credentials_path = ~/.config/linchpin

#keystore_path: "{{ playbook_dir }}/../keystore"


Expand Down Expand Up @@ -102,7 +105,7 @@ console = False

[states]
# in future each state will carry a comma seperated substates
preup = preup
preup = preup
predestroy = predestroy
postup = postup
postdestroy = postdestroy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
auth_driver:
filename: "{{ res_grp['credentials']['filename'] }}"
cred_type: "aws"
cred_path: "{{ creds_path }}"
cred_path: "{{ creds_path | default(default_credentials_path) }}"
driver: "file"
register: auth_var
ignore_errors: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
default_layouts_path: "{{ lookup('ini', 'default_layouts_path section=evars file={{ lpconfig }}') }}"
default_resources_path: "{{ lookup('ini', 'default_resources_path section=evars file={{ lpconfig }}') }}"
default_inventories_path: "{{ lookup('ini', 'default_inventories_path section=evars file={{ lpconfig }}') }}"
default_credentials_path: "{{ lookup('ini', 'default_credentials_path section=evars file={{ lpconfig }}') }}"
when: workspace is not defined

- name: set remaining evars from linchpin.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
auth_driver:
filename: "{{ res_grp['credentials']['filename'] }}"
cred_type: "gcloud"
cred_path: "{{ creds_path }}"
cred_path: "{{ creds_path | default(default_credentials_path) }}"
driver: "file"
register: auth_var
ignore_errors: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
auth_driver:
filename: "{{ cred_filename }}" # don't include the .yaml
cred_type: "openstack"
cred_path: "{{ creds_path | default('~/.config/openstack/') }}"
cred_path: "{{ creds_path | default(default_credentials_path) }}"
driver: "file"
register: auth_var
ignore_errors: true
Expand Down

0 comments on commit 5697909

Please sign in to comment.