Answer the question
In order to leave comments, you need to log in
Ansible + awx. What is the problem in yaml file?
I'm learning ansible, I'm trying to run at least one yaml for verification. Using Google, I wrote what is below to update the system via apt. But it doesn't work, I can't figure out what's wrong. Prompt the beginner - where to dig? Thanks in advance
---
- hosts: all
sudo: yes
tasks:
- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400
ERROR! 'apt' is not a valid attribute for a Play
The error appears to have been in '/var/lib/awx/projects/_8__test/test.yaml': line 5, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: Update and upgrade apt packages
^ here
Answer the question
In order to leave comments, you need to log in
Obviously the problem is indentation.
- hosts: all
sudo: yes
tasks:
- name: Update and upgrade apt packages
become: true
apt: upgrade=yes update_cache=yes cache_valid_time=86400
this is a python, the whole syntax is tied to indents, and they dance like a Christmas tree and you will understand what you wrote
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question