Rename the used SSH key
Because of "If the default insecure keypair is used, Vagrant will automatically replace it with a randomly generated keypair on first vagrant up. [GH-2608]" it is necessary to rename the used SSH key because it will be overwritten at the moment. Change-Id: If9ee3860c93fe7b0c825ba8403ae3e25647266f3
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
- yum: name=* state=latest
|
||||
- yum: name=openstack-selinux state=present
|
||||
- yum: name=vim-enhanced state=present
|
||||
- copy: src=files/id_rsa dest=/home/vagrant/.ssh/id_rsa mode=0600 owner=vagrant group=vagrant
|
||||
- copy: src=files/id_rsa.pub dest=/home/vagrant/.ssh/id_rsa.pub mode=0600 owner=vagrant group=vagrant
|
||||
- copy: src=files/id_rsa dest=/home/vagrant/.ssh/id_packstack mode=0600 owner=vagrant group=vagrant
|
||||
- copy: src=files/id_rsa.pub dest=/home/vagrant/.ssh/id_packstack.pub mode=0600 owner=vagrant group=vagrant
|
||||
- copy: src=files/selinux dest=/etc/selinux/config mode=0644 owner=root group=root
|
||||
- file: path=/home/vagrant/scripts state=directory owner=vagrant group=vagrant mode=0755
|
||||
- copy: src=files/disable_network_manager.sh dest=/home/vagrant/scripts/disable_network_manager.sh mode=0755 owner=vagrant group=vagrant
|
||||
- shell: cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys
|
||||
- shell: cat /home/vagrant/.ssh/id_packstack.pub >> /home/vagrant/.ssh/authorized_keys
|
||||
- file: path=/home/vagrant/.ssh/authorized_keys owner=vagrant group=vagrant
|
||||
- copy: src=files/motd dest=/etc/motd owner=root group=root mode=0644
|
||||
- template: src=files/hosts.j2 dest=/etc/hosts owner=root group=root mode=0644
|
||||
|
@@ -7,8 +7,8 @@ done
|
||||
chown vagrant:vagrant /home/vagrant/.ssh/known_hosts
|
||||
|
||||
for node in $(sed -n '/<<< Packstack >>>/{:a;n;/>>> Packstack <<</b;p;ba}' /etc/hosts | awk '{ print $2 }'); do
|
||||
ssh $node "sudo mkdir -p /root/.ssh"
|
||||
ssh $node "sudo chmod 700 /root/.ssh"
|
||||
ssh $node "sudo cp /home/vagrant/.ssh/* /root/.ssh"
|
||||
ssh $node "sudo chown -R root:root /root/.ssh"
|
||||
ssh -i $HOME/.ssh/id_packstack $node "sudo mkdir -p /root/.ssh"
|
||||
ssh -i $HOME/.ssh/id_packstack $node "sudo chmod 700 /root/.ssh"
|
||||
ssh -i $HOME/.ssh/id_packstack $node "sudo cp /home/vagrant/.ssh/* /root/.ssh"
|
||||
ssh -i $HOME/.ssh/id_packstack $node "sudo chown -R root:root /root/.ssh"
|
||||
done
|
||||
|
@@ -4,7 +4,7 @@
|
||||
# been installed on the remote servers the user will be prompted for a
|
||||
# password and this key will be installed so the password will not be
|
||||
# required again
|
||||
CONFIG_SSH_KEY=/home/vagrant/.ssh/id_rsa.pub
|
||||
CONFIG_SSH_KEY=/home/vagrant/.ssh/id_packstack.pub
|
||||
|
||||
# Set a default password everywhere. The default password will be
|
||||
# overriden by whatever password is set for each individual service or
|
||||
|
Reference in New Issue
Block a user