Skip to content

Commit

Permalink
[topology] Added cron to run update_topology command
Browse files Browse the repository at this point in the history
  • Loading branch information
rohithasrk authored and nemesifier committed Jul 21, 2017
1 parent 16e6621 commit 61f4e00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ openwisp2_sentry:
openwisp2_default_cert_validity: 1825
openwisp2_default_ca_validity: 3650
openwisp2_default_organization_id: 78f74fdd-67c6-4064-97e1-ce761da30745
openwisp2_topology_update_frequency:
day: "*"
hour: "*"
minute: "*/5"
9 changes: 9 additions & 0 deletions tasks/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: Install topology update cron
when: openwisp2_network_topology
become: true
cron:
name: "Update toplogies"
day: "{{ openwisp2_topology_update_frequency.day }}"
hour: "{{ openwisp2_topology_update_frequency.hour }}"
minute: "{{ openwisp2_topology_update_frequency.minute }}"
job: "{{ virtualenv_path }}/bin/python {{ openwisp2_path }}/manage.py update_topology"
4 changes: 4 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@

- include: nginx.yml
tags: [openwisp2, nginx]

- include: cron.yml
tags: [openwisp2, cron]
when: openwisp2_network_topology

1 comment on commit 61f4e00

@nemesifier
Copy link
Member

Choose a reason for hiding this comment

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

@rohithasrk merged

Please sign in to comment.