Skip to content
Snippets Groups Projects
Commit c2403abf authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

clean up the unused ansible files

Former-commit-id: 7080aac1ae6e9afcd322057b075e4ec48a3a150b
parent fc428003
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
ansible-playbook -i ./hosts $1
\ No newline at end of file
---
- name: Copy configuration files
hosts: all
gather_facts: no
tasks:
- name: nginx config file
template: src=../config/nginx.conf dest=/etc/nginx/sites-enabled/django
register: nginx_config
- name: nginx restart
service: name=nginx state=restarted
when: nginx_config.changed
- name: uwsgi config file
template: src=../config/uwsgi.ini dest=/etc/uwsgi/apps-enabled/django.ini
register: uwsgi_config
- name: uwsgi restart
service: name=uwsgi state=restarted
when: uwsgi_config.changed
---
- hosts: all
gather_facts: no
tasks:
- name: Running apt update
apt: update_cache=yes
- name: Installing required packages
apt: name={{item}} state=present
with_items:
- fail2ban
- postgresql
- postgresql-client
- git
- python-pip
- rdiff-backup
- libpq-dev
- python-psycopg2
- uwsgi
- uwsgi-plugin-python
- nginx
---
- hosts: all
become: yes
become_user: postgres
gather_facts: no
tasks:
- name: ensure database is created
postgresql_db: name={{dbname}}
- name: ensure user has access to database
postgresql_user: db={{dbname}} name={{dbuser}} password={{dbpassword}} priv=ALL
- name: ensure user does not have unnecessary privilege
postgresql_user: name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB
---
- hosts: all
gather_facts: no
tasks:
- name: Running update and safe-upgrade
apt:
update_cache=yes
upgrade=safe
register: result
- debug: var=result.stdout_lines
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment