Complete ansible toolkit with generation and validation capabilities
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
A platform team manages servers running both Ubuntu 22.04 and RHEL 9. They need a reusable Ansible role called redis that installs and configures Redis on both operating systems. The role should be robust enough to be shared across multiple teams and several projects.
The role should install Redis, deploy a redis.conf from a Jinja2 template (configuring bind address, port, and max memory), ensure the service is running and enabled, and handle the fact that RHEL 9 uses dnf while Ubuntu uses apt. The Redis port defaults to 6379 and max memory defaults to 256mb, but both should be overridable.
The team wants the role to be well-structured so new team members can easily understand and customise it without reading the entire codebase.
Produce a complete Ansible role directory structure for the redis role. Include at minimum:
tasks/main.ymlhandlers/main.ymldefaults/main.ymlvars/main.ymlvars/Debian.ymlvars/RedHat.ymltemplates/redis.conf.j2meta/main.ymlREADME.mdAlso produce a short example playbook example_playbook.yml that demonstrates how to use the role.