Skip to content

Commit

Permalink
Fix Crontab Specifying Wrong Wrapper Path (#5)
Browse files Browse the repository at this point in the history
This change fixes the cron timer method specifying the wrong path to the
wrapper script for launching `ansible-pull`.

* Bump python version for testing
  • Loading branch information
Brandon McNama authored May 11, 2020
1 parent 3607ca2 commit d4a6633
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
id: setup-python
uses: actions/setup-python@v1
with:
python-version: '3.8.0'
python-version: '3.8'
- name: Install poetry
id: install-poetry
run: |
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## Unreleased

## [0.1.2] - 2020-05-11

### Fixed

* When using the `cron` timer method, calculate the path of the wrapper script
correctly.

## [0.1.1] - 2019-01-16

Expand Down
12 changes: 6 additions & 6 deletions molecule/unprivileged/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lint:
name: yamllint
platforms:
- name: ubuntu-1604
image: dwsr/molecule-ubuntu-1604:20200112
image: dwsr/molecule-ubuntu-1604:20200510
command: /sbin/init
dockerfile: ../resources/docker/unprivileged.Dockerfile.j2
tmpfs:
Expand All @@ -17,7 +17,7 @@ platforms:
groups:
- ubuntu
- name: ubuntu-1804
image: dwsr/molecule-ubuntu-1804:20200112
image: dwsr/molecule-ubuntu-1804:20200510
command: /sbin/init
dockerfile: ../resources/docker/unprivileged.Dockerfile.j2
tmpfs:
Expand All @@ -27,7 +27,7 @@ platforms:
groups:
- ubuntu
- name: debian-9
image: dwsr/molecule-debian-9:20200112
image: dwsr/molecule-debian-9:20200510
command: /sbin/init
dockerfile: ../resources/docker/unprivileged.Dockerfile.j2
tmpfs:
Expand All @@ -37,7 +37,7 @@ platforms:
groups:
- debian
- name: debian-10
image: dwsr/molecule-debian-10:20200112
image: dwsr/molecule-debian-10:20200510
command: /sbin/init
dockerfile: ../resources/docker/unprivileged.Dockerfile.j2
tmpfs:
Expand All @@ -47,7 +47,7 @@ platforms:
groups:
- debian
- name: centos-7
image: dwsr/molecule-centos-7:20200112
image: dwsr/molecule-centos-7:20200510
command: /sbin/init
dockerfile: ../resources/docker/unprivileged.Dockerfile.j2
tmpfs:
Expand All @@ -57,7 +57,7 @@ platforms:
groups:
- centos_7
- name: centos-8
image: dwsr/molecule-centos-8:20200112
image: dwsr/molecule-centos-8:20200510
command: /sbin/init
dockerfile: ../resources/docker/unprivileged.Dockerfile.j2
tmpfs:
Expand Down
2 changes: 1 addition & 1 deletion molecule/unprivileged/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_crontab(host):
f = host.file("/var/spool/cron/crontabs/elbisna")
group = "crontab"

entry = "*/15 * * * * /home/elbisna/.ansible/do_ansible_pull > /dev/null 2>&1"
entry = "*/15 * * * * /home/elbisna/bin/do_ansible_pull > /dev/null 2>&1"

assert f.exists
assert f.is_file
Expand Down
2 changes: 1 addition & 1 deletion tasks/timer_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
backup: true
name: 'Ansible Pull run'
job: >
{{ ansible_pull_config_path }}/do_ansible_pull
{{ ansible_pull_install_path }}/do_ansible_pull
> /dev/null 2>&1
minute: "{{ ansible_pull_crontab_schedule['minute'] | default('*/5') }}"
hour: "{{ ansible_pull_crontab_schedule['hour'] | default('*') }}"
Expand Down

0 comments on commit d4a6633

Please sign in to comment.