Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure: fix SSH worflow #5316

Merged
merged 4 commits into from
Aug 25, 2022
Merged
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
28 changes: 24 additions & 4 deletions ansible/cloud_providers/azure_infrastructure_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
content: |
{
"adminUsername": { "value": "{{remote_user}}" }, {{ adminPassword }}
"sshKeyData": { "value": "{{ env_authorized_key_content_pub }}"},
"sshKeyData": { "value": "{{ ssh_provision_pubkey_content | default(env_authorized_key_content_pub) }}"},
"DNSZone": { "value": "{{HostedZoneId}}"},
"guid": { "value": "{{guid}}"},
}
Expand Down Expand Up @@ -186,12 +186,26 @@
# Copy env_vars variables from the config to all hosts
- import_playbook: ../include_vars.yml

- name: Configure local ssh config for bastion proxy use
import_playbook: "{{cloud_provider}}_ssh_config_setup.yml"
when: groups["bastions"] is defined and (groups["bastions"]|length>0)
- name: Step 001.2 Create Inventory and SSH config setup
hosts: localhost
connection: local
gather_facts: false
become: false
tags:
- must
- step001
- step001.2
- create_inventory
- create_ssh_config
tasks:
- when: create_ssh_config | default(true) | bool
block:
- name: Run Common SSH Config Generator Role
when:
- groups.bastions is defined
- groups.bastions | length > 0
include_role:
name: infra-common-ssh-config-generate

- name: wait_for_connection for all non-windows machines and set hostname
hosts:
Expand All @@ -203,6 +217,12 @@
- wait_ssh
- set_hostname
tasks:
- name: set facts for remote access
tags:
- create_inventory
set_fact:
ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ hostvars.localhost.ansible_ssh_config }}"

- name: wait for linux host to be available
wait_for_connection:
timeout: 300
Expand Down
81 changes: 0 additions & 81 deletions ansible/cloud_providers/azure_ssh_config_setup.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
- "{{ 'newnodes' if (item.tags.newnode|d()|bool) else 'all'}}"
ansible_user: "{{ remote_user }}"
remote_user: "{{ remote_user | d('azure') }}"
ansible_ssh_private_key_file: "{{ ssh_provision_key_path | default(env_authorized_key_path) }}"
key_name: "envkey"
state: "{{item.powerState|d('unknown')}}"
internaldns: "{{item.tags.internaldns | d(item.osProfile.computerName) |d(item.name)}}"
instance_id: "{{ item.vmId | d('unknown')}}"
Expand All @@ -69,7 +67,6 @@
private_dns_name: "{{item.tags.internaldns|d(item.name)}}"
private_ip_address: "{{item.privateIps}}"
public_ip_address: "{{item.publicIps}}"
ansible_host: "{{item.publicIps}}"
placement: "{{item.zones}}"
image_id: "{{item.storageProfile.osDisk.image|d('unknown')}}"
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
tar -czf {{ agnosticd_save_output_dir_archive_tempfile }} --exclude "google-cloud-sdk" .
args:
chdir: "{{ output_dir }}"
# Disable warning for using tar command rather than archive module.
# archive module does not support chdir type option.
warn: false

- when: agnosticd_save_output_dir_archive_password is defined
name: Encrypt tarball using password
Expand Down
1 change: 1 addition & 0 deletions docs/SSH_keys_and_access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This section describes how SSH keys are managed in agnosticd.
Here is the list of agnosticd cloud providers that follow this workflow:

* ec2
* azure

Long-term, we want all cloud providers to comply.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ krb5-libs
libcurl-devel
libxml2-devel
microdnf
openssl
openssl-devel
# Another distribution of python for extra CLIs and to avoid dependency hell
python36
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version: 1
build_arg_defaults:
# Get the full list from:
# https://catalog.redhat.com/software/containers/search?p=1&build_categories_list=Automation%20Execution%20Environment
EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:devel'
#EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:stable-2.12-latest'
#EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:devel'
EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:stable-2.12-latest'
#EE_BUILDER_IMAGE: 'registry.redhat.io/ansible-automation-platform-21/ansible-builder-rhel8'
#EE_BASE_IMAGE: registry.redhat.io/ansible-automation-platform-21/ee-29-rhel8:1.0.0-46
#EE_BASE_IMAGE: registry.redhat.io/ansible-automation-platform-21/ee-supported-rhel8:1.0.1-15
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
== Changelog ==
=== v0.0.7 ===

* add `openssl` binaries

=== v0.0.6 ===

* Cleanup requirements.txt file, let builder pull the dependencies from collections
Expand Down