Skip to content
Snippets Groups Projects
Commit 245c6b8d authored by MUNIER Florian's avatar MUNIER Florian
Browse files

[upd] rebond bastion

parent 5090fc74
No related branches found
No related tags found
No related merge requests found
[ssh_connection]
ssh_args = -F ssh.cfg
control_path = .ssh/mux-%r@%h:%p
\ No newline at end of file
control_path = ../.ssh/mux-%r@%h:%p
\ No newline at end of file
......@@ -2,9 +2,9 @@
resource "null_resource" "ansible" {
provisioner "local-exec" {
interpreter = ["/bin/bash", "-c"]
#command = "source /home/user/TP/Ansible/venv/ansible/bin/activate; ANSIBLE_HOST_KEY_CHECKING=False ansible -i ../Ansible/hosts.ini all -m ping --private-key .ssh/${var.INSTANCE_BASTION_KEY_PAIR}.pem -e pub_key=.ssh/${var.INSTANCE_BASTION_KEY_PAIR}.pub; deactivate"
command = "source /home/user/TP/Ansible/venv/ansible/bin/activate; ANSIBLE_HOST_KEY_CHECKING=False ansible -i ../Ansible/hosts.ini all -m ping; deactivate"
#command = "source /home/user/TP/Ansible/venv/ansible/bin/activate; ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i ../Ansible/hosts.ini ../Ansible/deploy.yml; deactivate"
command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i ../Ansible/hosts.ini ../Ansible/deploy.yml"
#command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i ../Ansible/hosts.ini ../Ansible/deploy.yml"
}
depends_on = [
openstack_compute_instance_v2.bastion_instance,
......
resource "null_resource" "ssh_cfg" {
provisioner "local-exec" {
command = "echo 'Host bastion\n Hostname ${openstack_networking_floatingip_v2.floatip_admin.address}\n User ubuntu\n IdentityFile .ssh/${var.INSTANCE_BASTION_KEY_PAIR}.pem\nHost 192.*\n ProxyCommand ssh -F ssh.cfg -W %h:%p bastion\n User ubuntu\n IdentityFile .ssh/${var.INSTANCE_ORCHEST_KEY_PAIR}.pem\nHost *\n ControlMaster auto\n ControlPath .ssh/mux-%r@%h:%p\n ControlPersist 15m' > ../Ansible/ssh.cfg"
command = "echo 'Host bastion\n Hostname ${openstack_networking_floatingip_v2.floatip_admin.address}\n User ubuntu\n IdentityFile ../.ssh/${var.INSTANCE_BASTION_KEY_PAIR}.pem\nHost 192.*\n ProxyCommand ssh -F ssh.cfg -W %h:%p bastion\n User ubuntu\n IdentityFile ../.ssh/${var.INSTANCE_ORCHEST_KEY_PAIR}.pem\nHost *\n ControlMaster auto\n ControlPath ../.ssh/mux-%r@%h:%p\n ControlPersist 15m' > ../Ansible/ssh.cfg"
}
depends_on = [openstack_compute_instance_v2.orchestration_instance]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment