Guest User

Untitled

a guest
Jan 29th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. ansible appserver -i environments/development --ask-vault-pass -k -e "ansible_user=vagrant" -m ping
  2.  
  3. sshd[1343]: Connection closed by 192.168.33.1 port 51481 [preauth]
  4.  
  5. [defaults]
  6. force_handlers = True
  7. hash_behaviour = merge
  8.  
  9. ansible 2.7.6
  10. config file = /mnt/d/Source/main_server/ansible/ansible.cfg
  11. configured module search path = [u'/home/my_user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  12. ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  13. executable location = /usr/bin/ansible
  14. python version = 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
  15. Using /mnt/d/Source/main_server/ansible/ansible.cfg as config file
  16. SSH password:
  17. Vault password:
  18. setting up inventory plugins
  19. /mnt/d/Source/main_server/ansible/environments/development did not meet host_list requirements, check plugin documentation if this is unexpected
  20. Parsed /mnt/d/Source/main_server/ansible/environments/development inventory source with ini plugin
  21. Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/minimal.pyc
  22. META: ran handlers
  23. Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8a35652610> for vault_id=default
  24. <192.168.33.10> ESTABLISH SSH CONNECTION FOR USER: vagrant
  25. <192.168.33.10> SSH: EXEC sshpass -d9 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/sseeland/.ansible/cp/d986014952 192.168.33.10 '/bin/sh -c '"'"'echo ~vagrant && sleep 0'"'"''
  26.  
  27. Vagrant.configure("2") do |config|
  28. config.vm.box = "debian/stretch64"
  29. config.vm.boot_timeout = 120
  30. config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
  31.  
  32. config.vm.provider "virtualbox" do |v|
  33. v.customize [ "modifyvm", :id, "--nictype1", "virtio" ]
  34. end
  35.  
  36. config.ssh.forward_agent = true
  37.  
  38. config.vm.define "dev" do |dev|
  39. # Setting up private_network to have reliable ip and port from host
  40. dev.vm.network :private_network, ip: "192.168.33.10", nic_type: "virtio"
  41.  
  42. # mount source code into machine
  43. dev.vm.synced_folder "../../svenseeland_site/", "/svenseeland_site/", type: "virtualbox"
  44. end
  45.  
  46. config.vm.define "staging" do |staging|
  47. # Setting up private_network to have reliable ip and port from host
  48. staging.vm.network :private_network, ip: "192.168.33.11", nic_type: "virtio"
  49. end
  50.  
  51. # set timezone
  52. config.vm.provision "shell", name: "set timezone", inline: <<-SHELL
  53. sudo rm /etc/localtime
  54. sudo ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
  55. SHELL
  56.  
  57. # add vagrant user to SSH group
  58. config.vm.provision "shell", name: "add vagrant user to SSH group", inline: <<-SHELL
  59. usermod -a -G ssh vagrant
  60. SHELL
  61.  
  62. # set root password
  63. config.vm.provision "shell", name: "set root password", inline: <<-SHELL
  64. echo -e "vagrantnvagrant" | sudo passwd
  65. SHELL
  66.  
  67. # enable passwordless root login to mirror the production server setup and open the door for Ansible
  68. config.vm.provision "shell", name: "enable keyless ssh login", inline: <<-SHELL
  69. sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
  70. echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
  71. service ssh restart
  72. SHELL
  73. end
Add Comment
Please, Sign In to add comment