Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Problema ao executar o Ansible

Depois de pedir ao Ansible para iniciar minhas tasks obtenho erro de permissão, mas os outros acessos conseguir sem problemas:

lucasmaranho@DESKTOP-842QFVJ:/mnt/c/git/aws-iac$ LC_ALL=C.UTF-8 ansible-playbook playbook.yml -u ubuntu --private-key key-agendar-aqui.pem -i hosts.yml:

-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) [WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

PLAY [app-agendar-aqui] ************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************* fatal: [54.232.52.137]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@ WARNING: UNPROTECTED PRIVATE KEY FILE! @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0555 for '/mnt/c/git/aws-iac/key-agendar-aqui.pem' are too open.\r\nIt is required that your private key files are NOT accessible by others.\r\nThis private key will be ignored.\r\nLoad key "/mnt/c/git/aws-iac/key-agendar-aqui.pem": bad permissions\r\nubuntu@54.232.52.137: Permission denied (publickey).", "unreachable": true}

PLAY RECAP ************************************************************************************************************************************************************* 54.232.52.137 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

lucasmaranho@DESKTOP-842QFVJ:/mnt/c/git/aws-iac$ ^C

1 resposta
solução!

Consegui resolver com essa solução:

Se você estiver usando WSL, você pode copiar o arquivo.pem para~/.ssh/

Copie o arquivo .pem:

cp file.pem ~/.ssh/

Alterar permissões:

chmod 600 ~/.ssh/file.pem eval ssh-agent -s ssh-add ~/.ssh/file.pem

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software