on the remote machine, I do:
create a remote
deploy user(a sudoer)
add my deployment machine public rsa key to /home/deploy/.ssh
sudo chmod 700 -R ~/.ssh && chmod 600 ~/.ssh/authorized_keys
then in /etc/sudoers:
deploy ALL=NOPASSWD: /bin/systemctl restart ansible_phoenix_build
adding a new service to /etc/systemd/system/ansible_phoenix_build.service
as in the README.md file
while in the .ansible
dir I try: ansible-playbook -i apps/production/inventory apps/production/deploy.yml -vvv
I get the error where rsync fails:
fatal: [maz.me]: FAILED! => {
"changed": false,
"cmd": "/usr/bin/rsync --delay-updates -F --compress --delete-after --archive --rsh=/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --rsync-path=sudo -u deploy rsync --out-format=<<CHANGED>>%i %n%L /tmp/ansible_phoenix_build/_build/prod/rel/ansible_phoenix_build/ [email protected]:/u/apps/ansible_phoenix_build/releases/2018.01.021957",
"invocation": {
"module_args": {
"_local_rsync_path": "rsync",
"_substitute_controller": false,
"archive": true,
"checksum": false,
"compress": true,
"copy_links": false,
"delete": true,
"dest": "[email protected]:/u/apps/ansible_phoenix_build/releases/2018.01.021957",
"dest_port": null,
"dirs": false,
"existing_only": false,
"group": null,
"links": null,
"mode": "push",
"owner": null,
"partial": false,
"perms": null,
"private_key": null,
"recursive": true,
"rsync_opts": null,
"rsync_path": "sudo -u deploy rsync",
"rsync_timeout": 0,
"set_remote_user": true,
"src": "/tmp/ansible_phoenix_build/_build/prod/rel/ansible_phoenix_build/",
"ssh_args": null,
"times": null,
"verify_host": false
}
},
"msg": "Warning: Permanently added 'maz.me,96.126.108.34' (ECDSA) to the list of known hosts.\r\nrsync: connection unexpectedly closed (8 bytes received so far) [sender]\nrsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52/rsync/io.c(453) [sender=2.6.9]\n",
"rc": 12
}
while in the ansible-phoenix-build
dir I do: bin/deploy
I get the error:
fatal: [maz.me]: UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp/ansible-tmp-1514941963.299496-109181809637189 `\" && echo ansible-tmp-1514941963.299496-109181809637189=\"` echo ~/.ansible/tmp/ansible-tmp-1514941963.299496-109181809637189 `\" ), exited with result 1",
"unreachable": true
}
What do the two errors mean? I believe with the former command I am much closer to deploying successfully. With the former is the issue that I am running the command with --root
?