Changed variables to all lower snake case for evobackup-client

Not just esthetic, for some reason ansible refused to run with '-'
somewhere and I just could not find where, changing variables and
tags to use '_' fixed it. It's more consistent anyway.
This commit is contained in:
Patrick Marchand 2019-09-06 17:49:40 -04:00
parent f9b55c0c91
commit d226ce594a
7 changed files with 45 additions and 45 deletions

View File

@ -1,12 +1,12 @@
---
evobackup-client__root_key_path: "/root/.ssh/evobackup_id"
evobackup-client__cron_path: "/etc/cron.daily/zzz_evobackup"
evobackup-client__cron_template_name: "zzz_evobackup"
evobackup-client__mail: null
evobackup-client__pid_path: "/var/run/evobackup.pid"
evobackup-client__log_path: "/var/log/evobackup.log"
evobackup-client__backup_path: "/home/backup"
evobackup-client__hosts: null
evobackup_client__root_key_path: "/root/.ssh/evobackup_id"
evobackup_client__cron_path: "/etc/cron.daily/zzz_evobackup"
evobackup_client__cron_template_name: "zzz_evobackup"
evobackup_client__mail: null
evobackup_client__pid_path: "/var/run/evobackup.pid"
evobackup_client__log_path: "/var/log/evobackup.log"
evobackup_client__backup_path: "/home/backup"
evobackup_client__hosts: null
# - name: "backups.example.org"
# ip: "xxx.xxx.xxx.xxx"
# fingerprint: "ecdsa-sha2-nistp256 ..."

View File

@ -2,20 +2,20 @@
- include: "ssh_key.yml"
tags:
- evobackup-client
- evobackup-client-backup-ssh_key
- evobackup_client
- evobackup_client_backup_ssh_key
- include: "upload_scripts.yml"
tags:
- evobackup-client
- evobackup-client-backup-scripts
- evobackup_client
- evobackup_client_backup_scripts
- include: "open_ssh_ports.yml"
tags:
- evobackup-client
- evobackup-client-backup-firewall
- evobackup_client
- evobackup_client_backup_firewall
- include: "verify_ssh.yml"
tags:
- evobackup-client
- evobackup-client-backup-hosts
- evobackup_client
- evobackup_client_backup_hosts

View File

@ -3,10 +3,10 @@
- name: Is there a Minifirewall ?
stat:
path: /etc/default/minifirewall
register: evobackup-client__minifirewall
register: evobackup_client__minifirewall
tags:
- evobackup-client
- evobackup-client-backup-firewall
- evobackup_client
- evobackup_client_backup_firewall
- name: Add backup SSH port in /etc/default/minifirewall
blockinfile:
@ -14,8 +14,8 @@
marker: "# {{ item.name }}"
block: |
/sbin/iptables -A INPUT -p tcp --sport {{ item.port }} --dport 1024:65535 -s {{ item.ip }} -m state --state ESTABLISHED,RELATED -j ACCEPT
with_items: "{{ evobackup-client__hosts }}"
when: evobackup-client__minifirewall.stat.exists
with_items: "{{ evobackup_client__hosts }}"
when: evobackup_client__minifirewall.stat.exists
tags:
- evobackup-client
- evobackup-client-backup-firewall
- evobackup_client
- evobackup_client_backup_firewall

View File

@ -4,17 +4,17 @@
user:
name: root
generate_ssh_key: true
ssh_key_file: "{{ evobackup-client__root_key_path }}"
ssh_key_file: "{{ evobackup_client__root_key_path }}"
ssh_key_type: rsa
register: evobackup-client__root_key
register: evobackup_client__root_key
tags:
- evobackup-client
- evobackup-client-backup-ssh_key
- evobackup_client
- evobackup_client_backup_ssh_key
- name: Print SSH key
debug:
var: evobackup-client__root_key.ssh_public_key
when: evobackup-client__root_key.ssh_public_key is defined
var: evobackup_client__root_key.ssh_public_key
when: evobackup_client__root_key.ssh_public_key is defined
tags:
- evobackup-client
- evobackup-client-backup-ssh_key
- evobackup_client
- evobackup_client_backup_ssh_key

View File

@ -3,14 +3,14 @@
- name: Upload evobackup script
template:
src: "{{ item }}"
dest: "{{ evobackup-client__cron_path }}"
dest: "{{ evobackup_client__cron_path }}"
force: true
mode: 0755
with_first_found:
- "templates/evobackup-client/{{ evobackup-client__cron_template_name }}.{{ inventory_hostname }}.sh.j2"
- "templates/evobackup-client/{{ evobackup-client__cron_template_name }}.{{ host_group }}.sh.j2"
- "templates/evobackup-client/{{ evobackup-client__cron_template_name }}.sh.j2"
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.{{ inventory_hostname }}.sh.j2"
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.{{ host_group }}.sh.j2"
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.sh.j2"
- "zzz_evobackup.default.sh.j2"
tags:
- evobackup-client
- evobackup-client-backup-scripts
- evobackup_client
- evobackup_client_backup_scripts

View File

@ -5,7 +5,7 @@
path: /root/.ssh/known_hosts
name: "[{{ item.name }}]:{{ item.port }}"
key: "[{{ item.name }}]:{{ item.port }} {{ item.fingerprint }}"
with_list: "{{ evobackup-client__hosts }}"
with_list: "{{ evobackup_client__hosts }}"
tags:
- evobackup-client
- evobackup-client-backup-hosts
- evobackup_client
- evobackup_client_backup_hosts

View File

@ -18,23 +18,23 @@
##### Configuration ###################################################
# email adress for notifications
MAIL={{ evobackup-client__mail }}
MAIL={{ evobackup_client__mail }}
# list of hosts (hostname or IP) and SSH port for Rsync
SERVERS="{% for host in evobackup-client__hosts %}{{ host.name }}:{{ host.port }}{% if loop.index != loop.length %} {% endif %}{% endfor %}"
SERVERS="{% for host in evobackup_client__hosts %}{{ host.name }}:{{ host.port }}{% if loop.index != loop.length %} {% endif %}{% endfor %}"
# timeout (in seconds) for SSH connections
SSH_CONNECT_TIMEOUT=30
## We use /home/backup : feel free to use your own dir
LOCAL_BACKUP_DIR="{{ evobackup-client__backup_path }}"
LOCAL_BACKUP_DIR="{{ evobackup_client__backup_path }}"
# You can set "linux" or "bsd" manually or let it choose automatically
SYSTEM=$(uname | tr '[:upper:]' '[:lower:]')
# Change these 2 variables if you have more than one backup cron
PIDFILE="{{ evobackup-client__pid_path }}"
LOGFILE="{{ evobackup-client__log_path }}"
PIDFILE="{{ evobackup_client__pid_path }}"
LOGFILE="{{ evobackup_client__log_path }}"
## Enable/Disable tasks
LOCAL_TASKS=${LOCAL_TASKS:-1}