Bom dia! Tudo bem?!
Estou com um problemas ao tenatr executar o ansible. Se gue erro e o arquivo playbook.yml
###################################################### ansible-playbook [core 2.16.6] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/paulo/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/paulo/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-playbook python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3) jinja version = 3.0.3 libyaml = True Using /etc/ansible/ansible.cfg as config file setting up inventory plugins Loading collection ansible.builtin from host_list declined parsing /home/paulo/learn-terraform-aws-instance/hosts.yml as it did not pass its verify_file() method script declined parsing /home/paulo/learn-terraform-aws-instance/hosts.yml as it did not pass its verify_file() method Not replacing invalid character(s) "{'-'}" in group name (tarraform-ansible) [WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details Not replacing invalid character(s) "{'-'}" in group name (tarraform-ansible) Parsed /home/paulo/learn-terraform-aws-instance/hosts.yml inventory source with ini plugin ERROR! conflicting action statements: copy, content
The error appears to be in '/home/paulo/learn-terraform-aws-instance/playbook.yml': line 3, column 5, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: criando o arquivo ^ here
############################
Arquivo
- hosts: terraform-ansible
tasks:
name: criando o arquivo copy: dest: /home/ubuntu/index.html content:
Feito com Terraform Ansible
name: criando o servidor shell: "nohup busybox httpd -f -p 8080 &"
Obrigado.