mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-07-04 11:19:20 +00:00
Remove variables.tf
This commit is contained in:
@ -1,65 +0,0 @@
|
||||
---
|
||||
- hosts: hifive
|
||||
become: yes
|
||||
become_user: root
|
||||
vars:
|
||||
http_port: 80
|
||||
domain: example.com
|
||||
tasks:
|
||||
- name: Install apache2
|
||||
apt:
|
||||
pkg:
|
||||
- apache2
|
||||
- python-passlib
|
||||
state: present
|
||||
|
||||
- name: Permissions apache2
|
||||
file:
|
||||
path: /etc/apache2
|
||||
owner: www-data
|
||||
group: www-data
|
||||
recurse: yes
|
||||
|
||||
- name: Permissions www
|
||||
file:
|
||||
path: /var/www
|
||||
owner: www-data
|
||||
group: www-data
|
||||
recurse: yes
|
||||
|
||||
- name: Start service httpd, if not started
|
||||
service:
|
||||
name: apache2
|
||||
state: started
|
||||
|
||||
- name: Enable service apache2, and not touch the state
|
||||
service:
|
||||
name: apache2
|
||||
enabled: yes
|
||||
|
||||
- name: Enable mod_rewrite
|
||||
apache2_module:
|
||||
name: rewrite
|
||||
state: present
|
||||
|
||||
- htpasswd:
|
||||
path: /etc/apache2/.htpasswd
|
||||
name: hifive
|
||||
password: hifive
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: 0640
|
||||
|
||||
- name: Create virtual host file
|
||||
template:
|
||||
src: virtualhost.j2
|
||||
dest: /etc/apache2/sites-available/{{ domain }}.conf
|
||||
force: yes
|
||||
|
||||
- name: a2ensite {{ domain }}
|
||||
command: a2ensite {{ domain }}
|
||||
|
||||
- name: Reload service apache2
|
||||
service:
|
||||
name: apache2
|
||||
state: reloaded
|
77
ops/ansible/httpd-centos.yml
Normal file
77
ops/ansible/httpd-centos.yml
Normal file
@ -0,0 +1,77 @@
|
||||
---
|
||||
- hosts: hifive
|
||||
become: yes
|
||||
become_user: root
|
||||
|
||||
tasks:
|
||||
- name: Yum update
|
||||
yum:
|
||||
name: '*'
|
||||
state: latest
|
||||
|
||||
- name: Install httpd
|
||||
yum:
|
||||
name: httpd
|
||||
state: latest
|
||||
|
||||
- name: Systemd enable httpd
|
||||
systemd:
|
||||
name: httpd
|
||||
enabled: yes
|
||||
masked: no
|
||||
|
||||
- name: Systemd start httpd
|
||||
systemd:
|
||||
name: httpd
|
||||
state: started
|
||||
|
||||
#- name: Permissions apache2
|
||||
#file:
|
||||
#path: /etc/apache2
|
||||
#owner: www-data
|
||||
#group: www-data
|
||||
#recurse: yes
|
||||
#
|
||||
#- name: Permissions www
|
||||
#file:
|
||||
#path: /var/www
|
||||
#owner: www-data
|
||||
#group: www-data
|
||||
#recurse: yes
|
||||
#
|
||||
#- name: Start service httpd, if not started
|
||||
#service:
|
||||
#name: apache2
|
||||
#state: started
|
||||
#
|
||||
#- name: Enable service apache2, and not touch the state
|
||||
#service:
|
||||
#name: apache2
|
||||
#enabled: yes
|
||||
#
|
||||
#- name: Enable mod_rewrite
|
||||
#apache2_module:
|
||||
#name: rewrite
|
||||
#state: present
|
||||
#
|
||||
#- htpasswd:
|
||||
#path: /etc/apache2/.htpasswd
|
||||
#name: hifive
|
||||
#password: hifive
|
||||
#owner: root
|
||||
#group: www-data
|
||||
#mode: 0640
|
||||
#
|
||||
#- name: Create virtual host file
|
||||
#template:
|
||||
#src: virtualhost.j2
|
||||
#dest: /etc/apache2/sites-available/{{ domain }}.conf
|
||||
#force: yes
|
||||
#
|
||||
#- name: a2ensite {{ domain }}
|
||||
#command: a2ensite {{ domain }}
|
||||
#
|
||||
#- name: Reload service apache2
|
||||
#service:
|
||||
#name: apache2
|
||||
#state: reloaded
|
Reference in New Issue
Block a user