finish configure stats
This commit is contained in:
parent
87ea635874
commit
c54c384178
@ -1,12 +1,12 @@
|
|||||||
- name: Deploy stats script
|
- name: Deploy stats script
|
||||||
import_tasks: stats.yml
|
import_tasks: stats.yml
|
||||||
tags: ["stats"]
|
tags: [ "configure", "stats"]
|
||||||
|
|
||||||
- name: Configure blacklist script
|
- name: Configure blacklist script
|
||||||
import_tasks: blacklist.yml
|
import_tasks: blacklist.yml
|
||||||
tags: [ "blacklist" ]
|
tags: [ "configure", "blacklist" ]
|
||||||
|
|
||||||
|
|
||||||
- name: Configure supervision script
|
- name: Configure supervision script
|
||||||
import_tasks: supervision.yml
|
import_tasks: supervision.yml
|
||||||
tags: ["supervision"]
|
tags: [ "configure", "supervision" ]
|
@ -3,145 +3,80 @@
|
|||||||
- name: Create sentinel directory
|
- name: Create sentinel directory
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
path: /usr/local/bin/sentinel
|
path: "{{ item }}/sentinel"
|
||||||
vars:
|
|
||||||
ansible_become: yes
|
|
||||||
ansible_become_method: sudo
|
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
|
||||||
|
|
||||||
- name: "all create directory "
|
|
||||||
file:
|
|
||||||
path: "/var/www/{{ item.git_name }}"
|
|
||||||
state: directory
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
mode: '500'
|
|
||||||
when: "item.git_name is defined and project_name is not defined and conf_name is not defined"
|
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ project }}"
|
- /usr/local/bin
|
||||||
|
- /etc
|
||||||
vars:
|
vars:
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
ansible_become_method: sudo
|
ansible_become_method: sudo
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
|
- name: Template virtualhost
|
||||||
- name: "all extract repo "
|
template:
|
||||||
unarchive:
|
src: virtualhost.j2
|
||||||
src: "/tmp/{{ item.git_name }}.tar.gz"
|
dest: /etc/sentinel/virtualhost
|
||||||
dest: "/var/www/{{ item.git_name }}"
|
mode: "0755"
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
mode: '500'
|
|
||||||
when: "item.git_name is defined and project_name is not defined and conf_name is not defined"
|
|
||||||
with_items:
|
|
||||||
- "{{ project }}"
|
|
||||||
vars:
|
vars:
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
ansible_become_method: sudo
|
ansible_become_method: sudo
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
|
- name: Template getinfo day script
|
||||||
- name: "single git archive"
|
template:
|
||||||
local_action:
|
src: getinfo_day.sh.j2
|
||||||
module: git
|
dest: /usr/local/bin/sentinel/getinfo_day.sh
|
||||||
repo: "https://{{ git_username | urlencode }}:{{ git_password | urlencode }}@git.valczeryba.ovh/v4l3n71n/{{ project_name }}.git"
|
mode: "0755"
|
||||||
dest: "/home/valentin/src/"
|
|
||||||
archive: "/tmp/{{ project_name }}.tar.gz"
|
|
||||||
force: yes
|
|
||||||
update: yes
|
|
||||||
when: "project_name is defined"
|
|
||||||
|
|
||||||
|
|
||||||
- name: "single create directory "
|
|
||||||
file:
|
|
||||||
path: "/var/www/{{ project_name }}"
|
|
||||||
state: directory
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
mode: '500'
|
|
||||||
when: "project_name is defined"
|
|
||||||
vars:
|
vars:
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
ansible_become_method: sudo
|
ansible_become_method: sudo
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
|
- name: Template getinfo month and week script
|
||||||
- name: "single extract repo "
|
|
||||||
unarchive:
|
|
||||||
src: "/tmp/{{ project_name }}.tar.gz"
|
|
||||||
dest: "/var/www/{{ project_name }}"
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
mode: '500'
|
|
||||||
when: "project_name is defined"
|
|
||||||
vars:
|
|
||||||
ansible_become: yes
|
|
||||||
ansible_become_method: sudo
|
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
|
||||||
|
|
||||||
- name: "copy nginx.conf"
|
|
||||||
copy:
|
copy:
|
||||||
src: "nginx.conf"
|
src: "getinfo_{{ item }}.sh.j2"
|
||||||
dest: "/etc/nginx/"
|
dest: "/usr/local/bin/sentinel/getinfo_{{ item }}.sh"
|
||||||
|
mode: "0755"
|
||||||
|
with_items:
|
||||||
|
- week
|
||||||
|
- month
|
||||||
vars:
|
vars:
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
ansible_become_method: sudo
|
ansible_become_method: sudo
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
- name: "all copy configure nginx"
|
- name: Crontab get info day
|
||||||
copy:
|
ansible.builtin.cron:
|
||||||
src: "{{ item.conf_name }}"
|
name: "get info day"
|
||||||
dest: "/etc/nginx/sites-available"
|
minute: "0"
|
||||||
when: "item.conf_name is defined and project_name is not defined and conf_name is not defined"
|
hour: "3"
|
||||||
with_items:
|
job: "bash /usr/local/bin/sentinel/getinfo_day.sh"
|
||||||
- "{{ project }}"
|
|
||||||
vars:
|
vars:
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
ansible_become_method: sudo
|
ansible_become_method: sudo
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
|
- name: Crontab get info week
|
||||||
- name: "all create symlink"
|
ansible.builtin.cron:
|
||||||
file:
|
name: "get info week"
|
||||||
src: "/etc/nginx/sites-available/{{ item.conf_name }}"
|
minute: "15"
|
||||||
dest: "/etc/nginx/sites-enabled/{{ item.conf_name }}"
|
hour: "3"
|
||||||
state: link
|
weekday: "1"
|
||||||
when: "item.conf_name is defined and project_name is not defined and conf_name is not defined"
|
job: "bash /usr/local/bin/sentinel/getinfo_week.sh"
|
||||||
with_items:
|
|
||||||
- "{{ project }}"
|
|
||||||
vars:
|
vars:
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
ansible_become_method: sudo
|
ansible_become_method: sudo
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
|
- name: Crontab get info month
|
||||||
- name: "single copy configure nginx"
|
ansible.builtin.cron:
|
||||||
copy:
|
name: "get info mongth"
|
||||||
src: "{{ conf_name }}"
|
minute: "30"
|
||||||
dest: "/etc/nginx/sites-available"
|
hour: "3"
|
||||||
when: "conf_name is defined"
|
day: "1"
|
||||||
|
job: "bash /usr/local/bin/sentinel/getinfo_month.sh"
|
||||||
vars:
|
vars:
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
ansible_become_method: sudo
|
ansible_become_method: sudo
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
|
|
||||||
- name: "single create symlink"
|
|
||||||
file:
|
|
||||||
src: "/etc/nginx/sites-available/{{ conf_name }}"
|
|
||||||
dest: "/etc/nginx/sites-enabled/{{ conf_name }}"
|
|
||||||
state: link
|
|
||||||
when: "conf_name is defined"
|
|
||||||
vars:
|
|
||||||
ansible_become: yes
|
|
||||||
ansible_become_method: sudo
|
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
|
||||||
|
|
||||||
- name: restart nginx
|
|
||||||
service:
|
|
||||||
name: nginx
|
|
||||||
state: restarted
|
|
||||||
vars:
|
|
||||||
ansible_become: yes
|
|
||||||
ansible_become_method: sudo
|
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
|
Loading…
x
Reference in New Issue
Block a user