Migrate from gitlab to gitea

This commit is contained in:
Arif Herusetyo Wicaksono 2019-02-18 20:43:55 +09:00
commit 6115a1d41c
7 changed files with 72 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
ansible.cfg
hosts
site.yml
*.retry

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Ansible Playbooks for system maintenance tasks
Collections of Ansible Playbooks for routine maintenance and troubleshooting.

View File

@ -0,0 +1,3 @@
---
- name: update all packages
yum: name=* state=latest

View File

@ -0,0 +1,18 @@
---
- name: install yum-cron and deltarpm
yum: name={{ item }} state=latest
with_items:
- deltarpm
- yum-cron
- name: set yum-cron to automatically apply update
lineinfile: dest=/etc/yum/yum-cron.conf regexp="apply_updates = no" state=present line="apply_updates = yes" backrefs=yes
- name: enable epel
yum: name=epel-release state=latest
- name: install development tools
yum: name=@development-tools state=latest
- name: enable ius
yum: name=https://centos7.iuscommunity.org/ius-release.rpm state=latest

View File

@ -0,0 +1,30 @@
---
- name: get ius repo install script (sponsored by rackspace)
get_url: url=https://setup.ius.io/ dest={{ home }}ius-setup force=no
- name: enable ius repo
shell: bash ius-setup removes={{ home }}ius-setup
become: yes
- name: delete ius script file after install
file: path={{ home }}ius-setup state=absent
- name: install python 3.5
yum: name={{ item }} state=latest
become: yes
with_items:
- python35u
- python35u-pip
- python-virtualenv
- name: create .virtualenv directory
file: path={{ venv }} state=directory
- name: create virtualenv
shell: pyvenv-3.5 {{ venv }}{{ project_name }} creates={{ venv }}{{ project_name }}
- name: create project directory
file: path={{ home }}{{ project_name }} state=directory
- name: install django
pip: name=django version=1.8 virtualenv={{ venv }}{{ project_name }}

View File

@ -0,0 +1,4 @@
---
- name: restart sshd
service: name=sshd state=restarted
when: gssapi.changed or dns.changed

View File

@ -0,0 +1,10 @@
---
- name: disable gss api authentication
lineinfile: dest=/etc/ssh/sshd_config regexp='^GSSAPIAu' state=present line='GSSAPIAuthentication no' backrefs=yes
register: gssapi
notify: restart sshd
- name: disable dns lookup
lineinfile: dest=/etc/ssh/sshd_config regexp='^#UseDNS\syes$' state=present line='UseDNS no' backrefs=yes
register: dns
notify: restart sshd