You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haproxy-wi/app/scripts/ansible/roles/geoip.yml

45 lines
1.0 KiB

- hosts: "{{ variable_host }}"
become: yes
become_method: sudo
tasks:
- name: Set SSH port
set_fact:
ansible_port: "{{SSH_PORT}}"
- name: Creates directory
file:
path: "{{haproxy_dir}}/geoip"
state: directory
- name: Creates directory
file:
path: "{{haproxy_dir}}/scripts"
state: directory
- name: Install wget
package:
name: "{{ item }}"
state: present
environment:
http_proxy: "{{PROXY}}"
https_proxy: "{{PROXY}}"
with_items:
- wget
- unzip
- name: Copy GeoIP script in place.
template:
src: /var/www/haproxy-wi/app/scripts/ansible/roles/geoip.sh.j2
dest: "{{haproxy_dir}}/scripts/geoip.sh"
mode: 0777
- name: Execute the script
command: "{{haproxy_dir}}/scripts/geoip.sh"
- name: Update geoip every Wednesday
cron:
name: "Update geoip"
minute: "0"
hour: "01"
weekday: "3"
job: "{{haproxy_dir}}/scripts/geoip.sh"