Address ansible_ssh_* var deprecation

Replacing usage of ansible_ssh_host, ansible_ssh_user,
ansible_ssh_port with ansible_host, ansible_user and ansible_port
Depends-On: I35371879a87c115f219cd181245fe59f6d7d3f77
Change-Id: I97c3958c406b44b271d361860516d0b903438a83
This commit is contained in:
Travis Truman 2016-09-13 17:04:09 -04:00 committed by Jesse Pretorius
parent 4fcf7a8caa
commit 1943251152
8 changed files with 54 additions and 54 deletions

View File

@ -38,8 +38,8 @@
- name: Wait for ssh to be available - name: Wait for ssh to be available
local_action: local_action:
module: wait_for module: wait_for
port: "{{ ansible_ssh_port | default('22') }}" port: "{{ ansible_port | default('22') }}"
host: "{{ ansible_ssh_host | default(inventory_hostname) }}" host: "{{ ansible_host | default(inventory_hostname) }}"
search_regex: OpenSSH search_regex: OpenSSH
delay: 1 delay: 1
- name: Add iptables rule for communication w/ metadata agent - name: Add iptables rule for communication w/ metadata agent

View File

@ -24,15 +24,15 @@
- name: Playbook for creating containers - name: Playbook for creating containers
hosts: all_containers hosts: all_containers
serial: 1 serial: 1
become: true become: True
gather_facts: false gather_facts: False
roles: roles:
- role: "lxc_container_create" - role: "lxc_container_create"
post_tasks: post_tasks:
- name: Wait for ssh to be available - name: Wait for ssh to be available
local_action: local_action:
module: wait_for module: wait_for
port: "{{ ansible_ssh_port | default('22') }}" port: "{{ ansible_port | default('22') }}"
host: "{{ ansible_ssh_host | default(inventory_hostname) }}" host: "{{ ansible_host | default(inventory_hostname) }}"
search_regex: OpenSSH search_regex: OpenSSH
delay: 1 delay: 1

View File

@ -64,7 +64,7 @@
tasks: tasks:
# Shell used because facts may not be ready yet # Shell used because facts may not be ready yet
- name: Get user home directory - name: Get user home directory
shell: "getent passwd '{{ ansible_ssh_user }}' | cut -d':' -f6" shell: "getent passwd '{{ ansible_user }}' | cut -d':' -f6"
register: user_home register: user_home
changed_when: false changed_when: false
@ -76,31 +76,31 @@
file: file:
path: "{{ calling_user_home }}/.ssh" path: "{{ calling_user_home }}/.ssh"
state: directory state: directory
owner: "{{ ansible_ssh_user }}" owner: "{{ ansible_user }}"
group: "{{ ansible_ssh_user }}" group: "{{ ansible_user }}"
mode: 0700 mode: 0700
when: ansible_ssh_user != 'root' when: ansible_user != 'root'
- name: Ensure user has the known private key - name: Ensure user has the known private key
copy: copy:
content: "{{ root_private_key }}" content: "{{ root_private_key }}"
dest: "{{ calling_user_home }}/.ssh/id_rsa" dest: "{{ calling_user_home }}/.ssh/id_rsa"
owner: "{{ ansible_ssh_user }}" owner: "{{ ansible_user }}"
group: "{{ ansible_ssh_user }}" group: "{{ ansible_user }}"
mode: "0600" mode: "0600"
when: ansible_ssh_user != 'root' when: ansible_user != 'root'
- name: Ensure user has the known public key - name: Ensure user has the known public key
copy: copy:
content: "{{ root_public_key }}" content: "{{ root_public_key }}"
dest: "{{ calling_user_home }}/.ssh/id_rsa.pub" dest: "{{ calling_user_home }}/.ssh/id_rsa.pub"
owner: "{{ ansible_ssh_user }}" owner: "{{ ansible_user }}"
group: "{{ ansible_ssh_user }}" group: "{{ ansible_user }}"
mode: "0600" mode: "0600"
when: ansible_ssh_user != 'root' when: ansible_user != 'root'
- name: Ensure local user can ssh to localhost - name: Ensure local user can ssh to localhost
authorized_key: authorized_key:
user: "{{ ansible_ssh_user }}" user: "{{ ansible_user }}"
key: "{{ root_public_key }}" key: "{{ root_public_key }}"
when: ansible_ssh_user != 'root' when: ansible_user != 'root'

View File

@ -84,7 +84,7 @@
- name: Wait for ssh to be available - name: Wait for ssh to be available
local_action: local_action:
module: wait_for module: wait_for
port: "{{ ansible_ssh_port | default('22') }}" port: "{{ ansible_port | default('22') }}"
host: "{{ ansible_ssh_host | default(inventory_hostname) }}" host: "{{ ansible_host | default(inventory_hostname) }}"
search_regex: OpenSSH search_regex: OpenSSH
delay: 1 delay: 1

View File

@ -43,13 +43,13 @@ galera_server_id: "{{ inventory_hostname | string_2_int }}"
# RabbitMQ Settings # RabbitMQ Settings
rabbitmq_cookie_token: secrete rabbitmq_cookie_token: secrete
rabbitmq_servers: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_ssh_host'] }}" rabbitmq_servers: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_host'] }}"
rabbitmq_use_ssl: False rabbitmq_use_ssl: False
rabbitmq_port: 5672 rabbitmq_port: 5672
# Memcache Settings # Memcache Settings
memcached_listen: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}" memcached_listen: "{{ hostvars[groups['memcached_all'][0]]['ansible_host'] }}"
memcached_servers: "{{ hostvars[groups['memcached_all'][0]]['ansible_ssh_host'] }}" memcached_servers: "{{ hostvars[groups['memcached_all'][0]]['ansible_host'] }}"
memcached_encryption_key: "secrete" memcached_encryption_key: "secrete"
# Keystone Settings # Keystone Settings
@ -59,11 +59,11 @@ keystone_admin_tenant_name: admin
keystone_auth_admin_password: "SuperSecretePassword" keystone_auth_admin_password: "SuperSecretePassword"
keystone_service_adminuri_insecure: false keystone_service_adminuri_insecure: false
keystone_service_internaluri_insecure: false keystone_service_internaluri_insecure: false
keystone_service_publicuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}:5000" keystone_service_publicuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:5000"
keystone_service_publicurl: "{{ keystone_service_publicuri }}/v3" keystone_service_publicurl: "{{ keystone_service_publicuri }}/v3"
keystone_service_internaluri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}:5000" keystone_service_internaluri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:5000"
keystone_service_internalurl: "{{ keystone_service_internaluri }}/v3" keystone_service_internalurl: "{{ keystone_service_internaluri }}/v3"
keystone_service_adminuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}:35357" keystone_service_adminuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:35357"
keystone_service_adminurl: "{{ keystone_service_adminuri }}/v3" keystone_service_adminurl: "{{ keystone_service_adminuri }}/v3"
keystone_service_password: "secrete" keystone_service_password: "secrete"
keystone_rabbitmq_password: "secrete" keystone_rabbitmq_password: "secrete"
@ -73,7 +73,7 @@ keystone_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
keystone_rabbitmq_userid: keystone keystone_rabbitmq_userid: keystone
keystone_rabbitmq_vhost: /keystone keystone_rabbitmq_vhost: /keystone
keystone_galera_database: keystone keystone_galera_database: keystone
keystone_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}" keystone_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
keystone_container_mysql_password: "SuperSecrete" keystone_container_mysql_password: "SuperSecrete"
keystone_venv_tag: "testing" keystone_venv_tag: "testing"
keystone_developer_mode: true keystone_developer_mode: true
@ -82,15 +82,15 @@ keystone_requirements_git_install_branch: master
keystone_service_region: RegionOne keystone_service_region: RegionOne
# Glance specific settings # Glance specific settings
glance_service_publicuri: "http://{{ hostvars[groups['glance_all'][0]]['ansible_ssh_host'] }}:9292" glance_service_publicuri: "http://{{ hostvars[groups['glance_all'][0]]['ansible_host'] }}:9292"
glance_service_publicurl: "{{ glance_service_publicuri }}" glance_service_publicurl: "{{ glance_service_publicuri }}"
glance_service_internaluri: "http://{{ hostvars[groups['glance_all'][0]]['ansible_ssh_host'] }}:9292" glance_service_internaluri: "http://{{ hostvars[groups['glance_all'][0]]['ansible_host'] }}:9292"
glance_service_internalurl: "{{ glance_service_internaluri }}" glance_service_internalurl: "{{ glance_service_internaluri }}"
glance_service_adminuri: "http://{{ hostvars[groups['glance_all'][0]]['ansible_ssh_host'] }}:9292" glance_service_adminuri: "http://{{ hostvars[groups['glance_all'][0]]['ansible_host'] }}:9292"
glance_service_adminurl: "{{ glance_service_adminuri }}" glance_service_adminurl: "{{ glance_service_adminuri }}"
glance_container_mysql_password: "SuperSecrete" glance_container_mysql_password: "SuperSecrete"
glance_developer_mode: true glance_developer_mode: true
glance_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}" glance_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
glance_galera_database: glance glance_galera_database: glance
glance_git_install_branch: master glance_git_install_branch: master
glance_profiler_hmac_key: "secrete" glance_profiler_hmac_key: "secrete"
@ -103,23 +103,23 @@ glance_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
glance_requirements_git_install_branch: master glance_requirements_git_install_branch: master
glance_service_password: "secrete" glance_service_password: "secrete"
glance_venv_tag: "testing" glance_venv_tag: "testing"
glance_host: "{{ hostvars[groups['glance_all'][0]]['ansible_ssh_host'] }}" glance_host: "{{ hostvars[groups['glance_all'][0]]['ansible_host'] }}"
glance_service_port: 9292 glance_service_port: 9292
# Nova specific settings # Nova specific settings
nova_api_container_mysql_password: "SuperSecrete" nova_api_container_mysql_password: "SuperSecrete"
nova_api_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}" nova_api_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
nova_api_galera_database: nova_api nova_api_galera_database: nova_api
nova_api_galera_user: nova_api nova_api_galera_user: nova_api
nova_container_mysql_password: "SuperSecrete" nova_container_mysql_password: "SuperSecrete"
nova_developer_mode: true nova_developer_mode: true
nova_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}" nova_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
nova_galera_database: nova nova_galera_database: nova
nova_git_install_branch: master nova_git_install_branch: master
nova_keystone_auth_plugin: password nova_keystone_auth_plugin: password
nova_management_address: "{{ ansible_ssh_host }}" nova_management_address: "{{ ansible_host }}"
nova_metadata_port: 8775 nova_metadata_port: 8775
nova_metadata_host: "{{ hostvars[groups['nova_api_metadata'][0]]['ansible_ssh_host'] }}" nova_metadata_host: "{{ hostvars[groups['nova_api_metadata'][0]]['ansible_host'] }}"
nova_metadata_proxy_secret: "secrete" nova_metadata_proxy_secret: "secrete"
nova_novncproxy_vncserver_listen: localhost nova_novncproxy_vncserver_listen: localhost
nova_novncproxy_vncserver_proxyclient_address: localhost nova_novncproxy_vncserver_proxyclient_address: localhost
@ -131,13 +131,13 @@ nova_rabbitmq_vhost: /nova
nova_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" nova_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
nova_requirements_git_install_branch: master nova_requirements_git_install_branch: master
nova_program_name: nova-api-os-compute nova_program_name: nova-api-os-compute
nova_service_adminuri: "http://{{ hostvars[groups['nova_api_os_compute'][0]]['ansible_ssh_host'] }}:8774" nova_service_adminuri: "http://{{ hostvars[groups['nova_api_os_compute'][0]]['ansible_host'] }}:8774"
nova_service_adminurl: "{{ nova_service_adminuri }}/v2.1/%(tenant_id)s" nova_service_adminurl: "{{ nova_service_adminuri }}/v2.1/%(tenant_id)s"
nova_service_publicuri: "http://{{ hostvars[groups['nova_api_os_compute'][0]]['ansible_ssh_host'] }}:8774" nova_service_publicuri: "http://{{ hostvars[groups['nova_api_os_compute'][0]]['ansible_host'] }}:8774"
nova_service_publicurl: "{{ nova_service_publicuri }}/v2.1/%(tenant_id)s" nova_service_publicurl: "{{ nova_service_publicuri }}/v2.1/%(tenant_id)s"
nova_service_internaluri: "http://{{ hostvars[groups['nova_api_os_compute'][0]]['ansible_ssh_host'] }}:8774" nova_service_internaluri: "http://{{ hostvars[groups['nova_api_os_compute'][0]]['ansible_host'] }}:8774"
nova_service_internalurl: "{{ nova_service_internaluri }}/v2.1/%(tenant_id)s" nova_service_internalurl: "{{ nova_service_internaluri }}/v2.1/%(tenant_id)s"
nova_spice_html5proxy_base_uri: "http://{{ hostvars[groups['nova_console'][0]]['ansible_ssh_host'] }}:6082" nova_spice_html5proxy_base_uri: "http://{{ hostvars[groups['nova_console'][0]]['ansible_host'] }}:6082"
nova_spice_html5proxy_base_url: "{{ nova_spice_html5proxy_base_uri }}/spice_auto.html" nova_spice_html5proxy_base_url: "{{ nova_spice_html5proxy_base_uri }}/spice_auto.html"
nova_service_password: "secrete" nova_service_password: "secrete"
nova_service_project_domain_id: default nova_service_project_domain_id: default
@ -154,11 +154,11 @@ lxd_trust_password: "SuperSecrete"
# Neutron specific settings # Neutron specific settings
neutron_container_mysql_password: SuperSecrete neutron_container_mysql_password: SuperSecrete
neutron_developer_mode: true neutron_developer_mode: true
neutron_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_ssh_host'] }}" neutron_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
neutron_galera_database: neutron neutron_galera_database: neutron
neutron_git_install_branch: master neutron_git_install_branch: master
neutron_ha_vrrp_auth_password: secrete neutron_ha_vrrp_auth_password: secrete
neutron_management_address: "{{ hostvars[groups['neutron_agent'][0]]['ansible_ssh_host'] }}" neutron_management_address: "{{ hostvars[groups['neutron_agent'][0]]['ansible_host'] }}"
neutron_rabbitmq_password: secrete neutron_rabbitmq_password: secrete
neutron_rabbitmq_port: "{{ rabbitmq_port }}" neutron_rabbitmq_port: "{{ rabbitmq_port }}"
neutron_rabbitmq_servers: "{{ rabbitmq_servers }}" neutron_rabbitmq_servers: "{{ rabbitmq_servers }}"
@ -166,11 +166,11 @@ neutron_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
neutron_rabbitmq_userid: neutron neutron_rabbitmq_userid: neutron
neutron_rabbitmq_vhost: /neutron neutron_rabbitmq_vhost: /neutron
neutron_requirements_git_install_branch: master neutron_requirements_git_install_branch: master
neutron_service_publicuri: "http://{{ hostvars[groups['neutron_agent'][0]]['ansible_ssh_host'] }}:9696" neutron_service_publicuri: "http://{{ hostvars[groups['neutron_agent'][0]]['ansible_host'] }}:9696"
neutron_service_publicurl: "{{ neutron_service_publicuri }}" neutron_service_publicurl: "{{ neutron_service_publicuri }}"
neutron_service_adminuri: "http://{{ hostvars[groups['neutron_agent'][0]]['ansible_ssh_host'] }}:9696" neutron_service_adminuri: "http://{{ hostvars[groups['neutron_agent'][0]]['ansible_host'] }}:9696"
neutron_service_adminurl: "{{ neutron_service_adminuri }}" neutron_service_adminurl: "{{ neutron_service_adminuri }}"
neutron_service_internaluri: "http://{{ hostvars[groups['neutron_agent'][0]]['ansible_ssh_host'] }}:9696" neutron_service_internaluri: "http://{{ hostvars[groups['neutron_agent'][0]]['ansible_host'] }}:9696"
neutron_serivce_internalurl: "{{ neutron_service_internaluri }}" neutron_serivce_internalurl: "{{ neutron_service_internaluri }}"
neutron_service_password: "secrete" neutron_service_password: "secrete"
neutron_service_project_name: service neutron_service_project_name: service
@ -183,7 +183,7 @@ cinder_backends_rbd_inuse: false
cinder_ceph_client: cinder cinder_ceph_client: cinder
# Swift specific settings # Swift specific settings
swift_storage_address: "{{ ansible_ssh_host }}" swift_storage_address: "{{ ansible_host }}"
swift_container_mysql_password: "SuperSecrete" swift_container_mysql_password: "SuperSecrete"
swift_dispersion_password: "secrete" swift_dispersion_password: "secrete"
swift_hash_path_prefix: "secrete_prefx" swift_hash_path_prefix: "secrete_prefx"
@ -193,9 +193,9 @@ swift_developer_mode: true
swift_git_install_branch: master swift_git_install_branch: master
swift_venv_tag: untagged swift_venv_tag: untagged
swift_venv_bin: "/openstack/venvs/swift-{{ swift_venv_tag }}/bin" swift_venv_bin: "/openstack/venvs/swift-{{ swift_venv_tag }}/bin"
swift_service_publicuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080" swift_service_publicuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_host'] }}:8080"
swift_service_adminuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080" swift_service_adminuri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_host'] }}:8080"
swift_service_internaluri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_ssh_host'] }}:8080" swift_service_internaluri: "http://{{ hostvars[groups['swift_proxy'][0]]['ansible_host'] }}:8080"
swift_replication_address: "{{ replication_address }}" swift_replication_address: "{{ replication_address }}"
swift: swift:
storage_network: eth1 storage_network: eth1
@ -239,4 +239,4 @@ tempest_service_available_swift: "{{ ((groups['swift_all'] is defined) and (grou
# openrc settings # openrc settings
openrc_os_password: "{{ keystone_auth_admin_password }}" openrc_os_password: "{{ keystone_auth_admin_password }}"
openrc_os_domain_name: "Default" openrc_os_domain_name: "Default"
openrc_os_auth_url: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_ssh_host'] }}:5000/v3" openrc_os_auth_url: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:5000/v3"

View File

@ -12,7 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
container_name: "{{ inventory_hostname }}" container_name: "{{ inventory_hostname }}"
container_networks: container_networks:
management_address: management_address:

View File

@ -1,7 +1,7 @@
[all] [all]
localhost ansible_connection=local ansible_become=True localhost ansible_become=True
infra1 ansible_ssh_host=10.1.0.2 ansible_host=10.1.0.2 ansible_become=True ansible_user=root infra1 ansible_host=10.1.0.2 ansible_become=True ansible_user=root
keystone1 ansible_ssh_host=10.1.0.3 ansible_host=10.1.0.3 ansible_become=True ansible_user=root keystone1 ansible_host=10.1.0.3 ansible_become=True ansible_user=root
[all_containers] [all_containers]
infra1 infra1

View File

@ -114,6 +114,7 @@ setenv =
# specified in ansible.cfg # specified in ansible.cfg
ANSIBLE_ROLES_PATH = {homedir}/.ansible/roles:{toxinidir}/.. ANSIBLE_ROLES_PATH = {homedir}/.ansible/roles:{toxinidir}/..
ANSIBLE_TRANSPORT = "ssh" ANSIBLE_TRANSPORT = "ssh"
commands = commands =
rm -rf {homedir}/.ansible/plugins rm -rf {homedir}/.ansible/plugins
git clone https://git.openstack.org/openstack/openstack-ansible-plugins \ git clone https://git.openstack.org/openstack/openstack-ansible-plugins \