Skip to content
Snippets Groups Projects
Commit 1385593a authored by Kamil Andoniadis's avatar Kamil Andoniadis
Browse files

Merge branch '16-remove-stack-name-prefix-from-hostnames' into 'master'

Resolve "Remove stack name prefix from hostnames"

Closes #16

See merge request muni-kypo-crp/backend-python/ansible-networking-stage/kypo-ansible-stage-one!17
parents 0cf11253 cefd8012
No related branches found
No related tags found
No related merge requests found
...@@ -220,3 +220,38 @@ ...@@ -220,3 +220,38 @@
dest: 'C:\Users\{{ ansible_user }}\.ssh\authorized_keys' dest: 'C:\Users\{{ ansible_user }}\.ssh\authorized_keys'
content: '{{ lookup("file", kypo_global_ssh_public_mgmt_key) }}' content: '{{ lookup("file", kypo_global_ssh_public_mgmt_key) }}'
- name: remove stack name prefix from hostnames of ssh nodes
hosts:
- management
- ssh_nodes
strategy: free
gather_facts: no
become: yes
tasks:
- name: set a new hostname
hostname:
name: '{{ inventory_hostname }}'
- name: remove stack name prefix from /etc/hosts file
replace:
path: /etc/hosts
regexp: '{{ kypo_global_sandbox_name }}-'
replace: ''
- name: remove stack name prefix from hostnames of winrm nodes
hosts:
- winrm_nodes
strategy: free
gather_facts: no
tasks:
- name: set a new hostname
win_hostname:
name: '{{ inventory_hostname }}'
register: win_hostname_return_value
- name: reboot machine
win_reboot:
when: win_hostname_return_value.reboot_required
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment