Skip to content

Ensure cron role uses include_tasks and installs cron - #75

Open
93jun wants to merge 3 commits into
devopshobbies:masterfrom
93jun:fix-cron-package-requirement
Open

Ensure cron role uses include_tasks and installs cron#75
93jun wants to merge 3 commits into
devopshobbies:masterfrom
93jun:fix-cron-package-requirement

Conversation

@93jun

@93jun 93jun commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This updates the create-cronjob role so it works in a clean recent Ansible environment.

The role had two separate compatibility issues:

  • tasks/main.yml used the removed bare include action.
  • The role used the Ansible cron module without first ensuring the cron/crontab tooling was installed.

This PR now handles both:

- ansible.builtin.include_tasks: configure.yml

and:

- name: Ensure cron is installed
  ansible.builtin.apt:
    name: cron
    state: present

Validation:

  • Checked the diff with git diff --check.
  • Re-ran the role path in a clean Ubuntu 22.04 container with ansible-core 2.16.
  • The updated role completed successfully:
ok=4 changed=2 failed=0

@93jun 93jun changed the title Ensure cron is installed before creating cron job Ensure cron role uses include_tasks and installs cron Jul 6, 2026

@mehdi-ra mehdi-ra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No breaking changes.
LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants