Change public key loading to allow a user to define a key
Moved the public key loading to a separate file so a user can define a key if so desired.
This commit is contained in:
parent
e16bdf274c
commit
96a003851b
@ -20,6 +20,7 @@ ipv4_gateway: This is the IPv4 defaut router address with-in the IPv4 subnet bei
|
||||
node_default_network_interface: This is the default network interface with-in the nodes to be deployed which the new IP configuration will be applied to. Note: This is likely to be deprecated and removed in the future as Bifrost will likely change methods utilized to include networking configuration into the configuration drive sufficiently that this should no longer be required.
|
||||
ipv4_nameserver: Defines the IPv4 Nameserver to configure the node with initially in order to support name resolution.
|
||||
ssh_public_key_path: Defines the path to the file to be SSH public key to be inserted into the configuraiton drive.
|
||||
ssh_public_key: If a user wishes to define an SSH public key as a string, this variable can be utilized which overrides ssh_public_key_path.
|
||||
|
||||
Customizing
|
||||
-----------
|
||||
|
@ -12,14 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
---
|
||||
- name: "Check to see if there is a file where the ssh_key_path is defined"
|
||||
local_action: stat path={{ ssh_public_key_path }}
|
||||
register: test_ssh_public_key_path
|
||||
- name: "Error if ssh_public_key_path is not valid"
|
||||
local_action: fail msg="ssh_public_key_path is not valid."
|
||||
when: test_ssh_public_key_path.stat.exists == false
|
||||
- name: "Read ssh public key in"
|
||||
local_action: set_fact ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}"
|
||||
- name: "Identify ssh_public_key if ssh_public_key_path is defined"
|
||||
include: ssh_public_key_path.yaml
|
||||
when: ssh_public_key is undefined and ssh_public_key_path is defined
|
||||
- name: "Name Make Temporary folder to build configdrive"
|
||||
local_action: command mktemp -d
|
||||
register: variable_configdrive_location
|
||||
|
23
roles/bifrost-configdrives/tasks/ssh_public_key_path.yaml
Normal file
23
roles/bifrost-configdrives/tasks/ssh_public_key_path.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
---
|
||||
- name: "Defined ssh_public_key_path - Check to see if there is a file where the ssh_public_key_path is defined"
|
||||
local_action: stat path={{ ssh_public_key_path }}
|
||||
register: test_ssh_public_key_path
|
||||
when: ssh_public_key_path is defined
|
||||
- name: "Defined ssh_public_key_path - Error if ssh_public_key_path is not valid"
|
||||
local_action: fail msg="ssh_public_key_path is not valid."
|
||||
when: test_ssh_public_key_path.stat.exists == false
|
||||
- name: "Defined ssh_public_key_path - Read ssh public key in"
|
||||
set_fact: ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}"
|
Loading…
Reference in New Issue
Block a user