1
votes

In ansible.cfg, I use the log_path variable to define where to save Ansible logs. A log file is generated and filled automatically but log rotation seems ineffective. I need information about Ansible logs rotation.

  • When does log rotates - daily, according to file size, … ?
  • Is it a file rotation or a file content rotation?

After defining log_path in ansible.cfg, I ran Ansible several times for several weeks. The logs are saved but there’s no rotation.

## ansible.cfg
log_path = /my/ansible/log.path

I would have two files:

  • /my/ansible/log.path contains latest logs
  • /my/ansible/log.path.0 for example contains oldest logs

but I only have all logs saved in /my/ansible/log.path.

1
there is no log rotation, not sure why you assumed there is one.ilias-sp
Thank you. I read this ansible.cfg example but I misunderstood the comment over log_path.symsymmas
i agree, it does sound misleading the way it was worded. in any case, the official documentation is here in case you want to have a deeper look.ilias-sp

1 Answers

1
votes

As written here, there’s no log rotation with Ansible.

# logging is off by default unless this path is defined
# if so defined, consider logrotate
#log_path = /var/log/ansible.log