ok guys did a bit of rtfm and my format for the hosts file was in no format so i did the yaml format with colons and begnnining with all: however no i get this
[root@sc-centos-1-2-1-build-1 ansible]# ansible ubuntu2004* -m file -a "path=/home/user1/file2.txt state=touch mode=700" [WARNING]: Could not match supplied host pattern, ignoring: ubuntu2004* [WARNING]: No hosts matched, nothing to do [root@sc-centos-1-2-1-build-1 ansible]# On Tue, 16 Mar 2021 at 10:34, Mohamed Rahiman <[email protected]> wrote: > Hi Guys sorry new to this and thanks to Antony Stone - sorry if im being > dents but im determined to learn this and glad i found such a great group > > so actually i did have the lines and took them out - now i am getting the > following > [WARNING]: * Failed to parse /etc/ansible/hosts with yaml plugin: YAML > inventory has invalid structure, it should be a dictionary, got: <class > 'ansible.parsing.yaml.objects.AnsibleUnicode'> > [WARNING]: * Failed to parse /etc/ansible/hosts with ini plugin: > /etc/ansible/hosts:1: Expected key=value host variable assignment, got: > ubuntu2004 > [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source > [WARNING]: No inventory was parsed, only implicit localhost is available > [WARNING]: provided hosts list is empty, only localhost is available. Note > that > the implicit localhost does not match 'all' > [WARNING]: Could not match supplied host pattern, ignoring: ubuntu2004* > > Basically all i am trying to do is the following - im going through th > basics > > > [root@sc-centos-1-2-1-build-1 ansible]# ansible ubuntu2004* -m file -a > "path=/home/user1/file2.txt state=touch mode=700" > > On Mon, 15 Mar 2021 at 19:53, Mohamed Rahiman <[email protected]> wrote: > >> >> Error reading config file (/etc/ansible/ansible.cfg): Source contains >> parsing errors: '<string>' [line 4]: ' 3 \n' #601 >> >> Hi Guys >> >> I am learning Ansible as a newbie so that i can get into the industry of >> IT, I am learning everything from scratch >> I have two hosts - hosts 1 and 2 >> i am trying to create a file from host 1 to host 2 - using ansible when i >> do this i get the following >> >> Error reading config file (/etc/ansible/ansible.cfg): Source contains >> parsing errors: '' >> [line 4]: ' 3 \n' >> [line 5]: ' 4 # nearly all parameters can be overridden in >> ansible-playbook\n' >> [line 6]: ' 5 # or with command line flags. ansible will read >> ANSIBLE_CONFIG,\n' >> [line 7]: ' 6 # ansible.cfg in the current working directory, >> .ansible.cfg in\n' >> [line 8]: ' 7 # the home directory or /etc/ansible/ansible.cfg, whichever >> it\n' >> [line 9]: ' 8 # finds first\n' >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/6399a87a-5473-4acc-a974-c339eb458e0fn%40googlegroups.com >> <https://groups.google.com/d/msgid/ansible-project/6399a87a-5473-4acc-a974-c339eb458e0fn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMWqvZFySP6DMm6oWZBy%3DQ2EyqBRGcTQrWJrECdMXxRNcfn8nw%40mail.gmail.com.
