Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ansible appserver -i environments/development --ask-vault-pass -k -e "ansible_user=vagrant" -m ping
- sshd[1343]: Connection closed by 192.168.33.1 port 51481 [preauth]
- [defaults]
- force_handlers = True
- hash_behaviour = merge
- ansible 2.7.6
- config file = /mnt/d/Source/main_server/ansible/ansible.cfg
- configured module search path = [u'/home/my_user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
- ansible python module location = /usr/lib/python2.7/dist-packages/ansible
- executable location = /usr/bin/ansible
- python version = 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
- Using /mnt/d/Source/main_server/ansible/ansible.cfg as config file
- SSH password:
- Vault password:
- setting up inventory plugins
- /mnt/d/Source/main_server/ansible/environments/development did not meet host_list requirements, check plugin documentation if this is unexpected
- Parsed /mnt/d/Source/main_server/ansible/environments/development inventory source with ini plugin
- Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/minimal.pyc
- META: ran handlers
- Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f8a35652610> for vault_id=default
- <192.168.33.10> ESTABLISH SSH CONNECTION FOR USER: vagrant
- <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'"'"''
- Vagrant.configure("2") do |config|
- config.vm.box = "debian/stretch64"
- config.vm.boot_timeout = 120
- config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
- config.vm.provider "virtualbox" do |v|
- v.customize [ "modifyvm", :id, "--nictype1", "virtio" ]
- end
- config.ssh.forward_agent = true
- config.vm.define "dev" do |dev|
- # Setting up private_network to have reliable ip and port from host
- dev.vm.network :private_network, ip: "192.168.33.10", nic_type: "virtio"
- # mount source code into machine
- dev.vm.synced_folder "../../svenseeland_site/", "/svenseeland_site/", type: "virtualbox"
- end
- config.vm.define "staging" do |staging|
- # Setting up private_network to have reliable ip and port from host
- staging.vm.network :private_network, ip: "192.168.33.11", nic_type: "virtio"
- end
- # set timezone
- config.vm.provision "shell", name: "set timezone", inline: <<-SHELL
- sudo rm /etc/localtime
- sudo ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
- SHELL
- # add vagrant user to SSH group
- config.vm.provision "shell", name: "add vagrant user to SSH group", inline: <<-SHELL
- usermod -a -G ssh vagrant
- SHELL
- # set root password
- config.vm.provision "shell", name: "set root password", inline: <<-SHELL
- echo -e "vagrantnvagrant" | sudo passwd
- SHELL
- # enable passwordless root login to mirror the production server setup and open the door for Ansible
- config.vm.provision "shell", name: "enable keyless ssh login", inline: <<-SHELL
- sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
- echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
- service ssh restart
- SHELL
- end
Add Comment
Please, Sign In to add comment