Execution of Ansible playbook now reflecting any changes

0 votes

I have an Ansible playbook that to configure hostname on VyOS Server. I'm not getting an error and also I cant see an output if the playbook is getting executed successfully. 

Playbook:

--- 
 - hosts : server
   vars:
    inventory_hostname : vyos_host
   name : setting host name
      vyos_config
        lines
          - set system host-name {{ inventory_hostname }}
Jan 17, 2019 in Ansible by Moana
772 views

2 answers to this question.

0 votes

Hey @Moana, you playbook is missing the tasks session and even the identations aren't how they are suppossed to be. 

Write it something like this:

--- 
 - hosts : server
   vars:
     inventory_hostname : vyos_host
   tasks:
     - name : setting host name
       vyos_config:
         lines:
           - set system host-name {{ inventory_hostname }}
answered Jan 17, 2019 by Sameer
0 votes

Hey @Moana, you playbook is missing the tasks session and even the identations aren't how they are suppossed to be. 

Write it something like this:

--- 
 - hosts : server
   vars:
     inventory_hostname : vyos_host
   tasks:
     - name : setting host name
       vyos_config:
         lines:
           - set system host-name {{ inventory_hostname }}
answered Jan 17, 2019 by Sameer

Related Questions In Ansible

0 votes
1 answer

How to skip execution of a task in ansible playbook ??

Define tags...  Then while running playbook use --skip-tags. READ MORE

answered Sep 30, 2020 in Ansible by Adil
10,827 views
0 votes
1 answer
0 votes
1 answer

Error while running playbook consisting of roles - Ansible

You get this error because ansible was ...READ MORE

answered Mar 12, 2019 in Ansible by William
2,672 views
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,041 views
+2 votes
1 answer
0 votes
1 answer

Role of subelement module in an Ansible playbook

Hey @Rahul thanks for a better question ...READ MORE

answered Jan 16, 2019 in Ansible by Emily
2,397 views
0 votes
1 answer

Ansible playbook to automate security configurations of an EC2 instance

Hey @Kiara, your indentation is very wrong. ...READ MORE

answered Jan 24, 2019 in Ansible by Harsh
802 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP