[ansible-project] Re: Ansible deployng VM and transfering and execute shell script on remote host
Hi Racke , I moved the script to /tmp directory and also changed permission to 777. In the playbook I just put: - name: testing script: /tmp/shell.sh The virtual machine is created with success and I figured out that the shell script is executed with success but in the localhost (ansible machine) instead of remote vm. [image: Ansible_error_1.PNG] [image: Ansible_error_2.PNG] Do you know some way to hit the new virtual machine instead of localhost? Kindly Regards, Julio Em quarta-feira, 4 de março de 2020 15:46:43 UTC-3, Julio Cesar Caraca escreveu: > > Hi Guys, > > I got a playbook to deploy virtual machines and it´s working very well. > > And now I´m trying to transfer and execute a shell script during the > deploy of virtual machine but I´m getting many issues when changing the > playbook. > > Has anyone been faced this need as well? > > Cheers, > > Julio > > > > > > -- AVISO LEGAL: Esta mensagem, incluindo seus anexos, é destinada exclusivamente para a(s) pessoa(s) a quem é dirigida, podendo conter informação confidencial e/ou privilegiada. Se você não for destinatário desta mensagem, desde já fica notificado de abster-se de utilizar a informação contida nesta mensagem de qualquer forma, sujeitando o infrator às penas da lei, notificar o remetente e eliminar o seu conteúdo de forma definitiva. Informações transmitidas por e-mail podem ser alteradas por terceiros, não havendo garantia de que sua integridade foi mantida e que esteja livre de vírus, interceptação ou interferência, não podendo ser imputada qualquer responsabilidade à TOTVS com relação ao seu conteúdo. LEGAL NOTICE: This message, including its attachments, is intended exclusively for the people to whom it is addressed, and may contain confidential and/or privileged information. If you are not a recipient of this message, you are hereby notified to refrain from using the information contained in this message, subjecting the infringer to the penalties of the law. Information transmitted by e-mail may be changed by third parties, and there is no guarantee that its integrity has been maintained and that it is free of viruses, interception or interference, and no responsibility will be attributed to TOTVS in relation to its content. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e06e91a6-a788-41fd-96eb-19509968f796%40googlegroups.com.
[ansible-project] Re: Ansible deployng VM and transfering and execute shell script on remote host
Hi Racke, Thanks for the answer! All configuration that I´ve been trying is based on this documentation: https://docs.ansible.com/ansible/latest/modules/shell_module.html Although I´m getting error the virtual machine is been created but without the copy and execution of shell script: [image: Ansible_error_1.PNG] I just added the following lines in the playbook: - name: testing copy copy: src: /root/shell.sh dest: /tmp delegate_to: localhost - name: testing execute shell: /tmp/shell.sh This is my playbook: [image: Ansible_error_2.PNG] A simple shell script only for testing: [image: Ansible_error_3.PNG] Really appreciate any help. Thanks in advance! Julio Em quarta-feira, 4 de março de 2020 15:46:43 UTC-3, Julio Cesar Caraca escreveu: > > Hi Guys, > > I got a playbook to deploy virtual machines and it´s working very well. > > And now I´m trying to transfer and execute a shell script during the > deploy of virtual machine but I´m getting many issues when changing the > playbook. > > Has anyone been faced this need as well? > > Cheers, > > Julio > > > > > > -- AVISO LEGAL: Esta mensagem, incluindo seus anexos, é destinada exclusivamente para a(s) pessoa(s) a quem é dirigida, podendo conter informação confidencial e/ou privilegiada. Se você não for destinatário desta mensagem, desde já fica notificado de abster-se de utilizar a informação contida nesta mensagem de qualquer forma, sujeitando o infrator às penas da lei, notificar o remetente e eliminar o seu conteúdo de forma definitiva. Informações transmitidas por e-mail podem ser alteradas por terceiros, não havendo garantia de que sua integridade foi mantida e que esteja livre de vírus, interceptação ou interferência, não podendo ser imputada qualquer responsabilidade à TOTVS com relação ao seu conteúdo. LEGAL NOTICE: This message, including its attachments, is intended exclusively for the people to whom it is addressed, and may contain confidential and/or privileged information. If you are not a recipient of this message, you are hereby notified to refrain from using the information contained in this message, subjecting the infringer to the penalties of the law. Information transmitted by e-mail may be changed by third parties, and there is no guarantee that its integrity has been maintained and that it is free of viruses, interception or interference, and no responsibility will be attributed to TOTVS in relation to its content. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/15111899-3261-4628-b9aa-112a88305809%40googlegroups.com.
[ansible-project] Ansible deployng VM and transfering and execute shell script on remote host
Hi Guys, I got a playbook to deploy virtual machines and it´s working very well. And now I´m trying to transfer and execute a shell script during the deploy of virtual machine but I´m getting many issues when changing the playbook. Has anyone been faced this need as well? Cheers, Julio -- AVISO LEGAL: Esta mensagem, incluindo seus anexos, é destinada exclusivamente para a(s) pessoa(s) a quem é dirigida, podendo conter informação confidencial e/ou privilegiada. Se você não for destinatário desta mensagem, desde já fica notificado de abster-se de utilizar a informação contida nesta mensagem de qualquer forma, sujeitando o infrator às penas da lei, notificar o remetente e eliminar o seu conteúdo de forma definitiva. Informações transmitidas por e-mail podem ser alteradas por terceiros, não havendo garantia de que sua integridade foi mantida e que esteja livre de vírus, interceptação ou interferência, não podendo ser imputada qualquer responsabilidade à TOTVS com relação ao seu conteúdo. LEGAL NOTICE: This message, including its attachments, is intended exclusively for the people to whom it is addressed, and may contain confidential and/or privileged information. If you are not a recipient of this message, you are hereby notified to refrain from using the information contained in this message, subjecting the infringer to the penalties of the law. Information transmitted by e-mail may be changed by third parties, and there is no guarantee that its integrity has been maintained and that it is free of viruses, interception or interference, and no responsibility will be attributed to TOTVS in relation to its content. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/63ddba08-7b7b-4d3f-bebd-b2f80b75c277%40googlegroups.com.