Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion devkit_proxmox.STDIN.stdin_or_jsons.to.jsons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ NEW_KEY_FIELD_NAME_FROM_STDIN=$(extract_new_key_field_name_from_stdin "$1")

JSON_LINE_REQ=$(

{ [ -t 0 ] && printf "%s\n" "$VAULT_NODE" || cat -; } |
{ [ -t 0 ] && printf "%s
" "$VAULT_NODE" || { _STDIN=$(cat -); [ -n "$_STDIN" ] && printf "%s
" "$_STDIN" || printf "%s
" "$VAULT_NODE"; }; } |
jq -R -c --arg key "$NEW_KEY_FIELD_NAME_FROM_STDIN" '
(fromjson? // .) as $v_to_evaluate |
if ($v_to_evaluate | type) == "object" then
Expand Down
8 changes: 5 additions & 3 deletions proxmox__inc.jsons.basic_vm_actions.to.jsons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ if [ ! -t 0 ]; then
assign_if_not_empty "dest_proxmox_storage" "$line" ".dest_proxmox_storage"

# ARG_ACTION=$(printf "%s\n" "$line" | jq -r ".action")
PROXMOX_NODE=$(printf "%s\n" "$line" | jq -r ".proxmox_node")
PROXMOX_NODE=$(printf "%s
" "$line" | jq -r ".proxmox_node")
ANSIBLE_HOST="${RANGE42_INFRASTRUCTURE_CODENAME:-$PROXMOX_NODE}"

#### DEBUG purpose.

Expand All @@ -282,7 +284,7 @@ if [ ! -t 0 ]; then
(
ANSIBLE_CONFIG="$ANSIBLE_CONFIG" \
ansible-playbook -i "$INVENTORY" "${VAULT_ARGS[@]}" /dev/stdin <<PLAYBOOK
- hosts: $PROXMOX_NODE
- hosts: $ANSIBLE_HOST
gather_facts: false
vars_files:
- "$PLAYBOOK_VARS_FILE"
Expand All @@ -306,7 +308,7 @@ EOF
(
ANSIBLE_CONFIG="$ANSIBLE_CONFIG" \
ansible-playbook -i "$INVENTORY" "${VAULT_ARGS[@]}" /dev/stdin <<EOF
- hosts: $PROXMOX_NODE
- hosts: $ANSIBLE_HOST
gather_facts: false
vars_files:
- "$PLAYBOOK_VARS_FILE"
Expand Down