Refactor server roles into one that handles all OS physical or virtual
This commit is contained in:
59
README.md
59
README.md
@@ -9,3 +9,62 @@ For example:
|
||||
Main ansible is ~/Code/ansible
|
||||
Clone this repo into ~/Code/ansible-shared
|
||||
ln -s ~/Code/ansible-shared ~/Code/ansible/playbooks/roles/shared
|
||||
|
||||
|
||||
# Requirements
|
||||
|
||||
These shared roles are geared toward Debian 9 and 10 with a few compatible with Ubuntu.
|
||||
|
||||
These shared roles assume a fresh stock Debian base with the main user being `toor`.
|
||||
|
||||
|
||||
# Snippets
|
||||
|
||||
Quick helpers to remember common tasks
|
||||
|
||||
|
||||
```yaml
|
||||
# Copy profiles to /etc/profile.d/
|
||||
- include_tasks: ../../../functions/copy_etc-profile.d.yml
|
||||
|
||||
# Copy scripts to /usr/local/bin
|
||||
- include_tasks: ../../../functions/copy_usr-local-bin.yml
|
||||
|
||||
# Copy nginx.conf
|
||||
- name: Copying /etc/nginx/nginx.conf
|
||||
copy:
|
||||
src: nginx/nginx.conf
|
||||
dest: /etc/nginx/nginx.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: restart nginx
|
||||
|
||||
# Install common apps for all debian machines
|
||||
- name: Installing Debian common applications
|
||||
apt:
|
||||
update_cache: yes
|
||||
state: present
|
||||
name:
|
||||
- apt-transport-https
|
||||
- openssh-server
|
||||
|
||||
# Creat directory /etc/nginx
|
||||
- name: Create a directory if it does not exist
|
||||
file:
|
||||
path: /etc/nginx
|
||||
state: directory
|
||||
owner: toor
|
||||
group: toor
|
||||
mode: '0755'
|
||||
|
||||
# Set chown toor:toor -R /etc/nginx
|
||||
- name: Applying ownership of /etc/nginx
|
||||
file:
|
||||
path: /etc/nginx
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: toor
|
||||
group: toor
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user