-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
527845a
commit c8d325b
Showing
11 changed files
with
111 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ | |
tags: ['ssh'] | ||
- role: packages | ||
tags: ['packages'] | ||
- role: nginx | ||
tags: ['nginx'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
--- | ||
|
||
- name: red prompt for root | ||
lineinfile: dest=/root/.bashrc line="export PS1='[\[\e[0;31m\]\u@\h\[\e[0m\] \W]\$ '" | ||
lineinfile: | ||
dest: /root/.bashrc | ||
line: "export PS1='[\\[\\e[0;31m\\]\\u@\\h\\[\\e[0m\\] \\W]\\$ '" | ||
|
||
- name: include .bash_aliases in /root/.bashrc | ||
lineinfile: dest=/root/.bashrc line="source /root/.bash_aliases" | ||
lineinfile: | ||
dest: /root/.bashrc | ||
line: "source /root/.bash_aliases" | ||
|
||
- name: /root/.bash_aliases | ||
copy: src=bash_aliases dest=/root/.bash_aliases | ||
copy: | ||
src: bash_aliases | ||
dest: /root/.bash_aliases | ||
|
||
- name: /root/.emacs | ||
copy: src=emacs dest=/root/.emacs | ||
copy: | ||
src: emacs | ||
dest: /root/.emacs | ||
|
||
- name: include .bash_aliases in /home/ubuntu/.bashrc | ||
lineinfile: dest=/home/ubuntu/.bashrc line="source /home/ubuntu/.bash_aliases" | ||
lineinfile: | ||
dest: /home/ubuntu/.bashrc | ||
line: "source /home/ubuntu/.bash_aliases" | ||
|
||
- name: /home/ubuntu/.bash_aliases | ||
copy: src=bash_aliases dest=/home/ubuntu/.bash_aliases | ||
copy: | ||
src: bash_aliases | ||
dest: /home/ubuntu/.bash_aliases | ||
|
||
- name: /home/ubuntu/.emacs | ||
copy: src=emacs dest=/home/ubuntu/.emacs | ||
copy: | ||
src: emacs | ||
dest: /home/ubuntu/.emacs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
server { | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
|
||
# listen 443 ssl default_server; | ||
# listen [::]:443 ssl default_server; | ||
|
||
root /var/www/html; | ||
|
||
index index.html; | ||
|
||
server_name data.isimip.org; | ||
|
||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
server { | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
|
||
# listen 443 ssl default_server; | ||
# listen [::]:443 ssl default_server; | ||
|
||
root /var/www/html; | ||
|
||
index index.html; | ||
|
||
server_name files.isimip.org; | ||
|
||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
- name: restart nginx | ||
service: | ||
name: nginx | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
|
||
- name: nginx is installed | ||
apt: name=nginx state=present | ||
|
||
- name: nginx config is present | ||
copy: | ||
src: "{{ ansible_host }}.conf" | ||
dest: /etc/nginx/sites-available/default | ||
notify: | ||
- restart nginx | ||
|
||
- name: index.html is present | ||
template: | ||
src: index.html | ||
dest: /var/www/html/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
|
||
<head> | ||
<title>{{ ansible_host }}</title> | ||
<meta charset="UTF-8" /> | ||
|
||
<style> | ||
body {font-family: sans;} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<h1>{{ ansible_host }}</h1> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
--- | ||
|
||
- name: all packages are on the latest version | ||
apt: update_cache=yes upgrade=dist | ||
apt: | ||
upgrade: dist | ||
update_cache: yes | ||
|
||
- name: common packages are present | ||
apt: name="{{ packages }}" state=present | ||
apt: | ||
name: "{{ packages }}" | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
|
||
packages: | ||
- aptitude | ||
- sudo | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
--- | ||
|
||
- name: ssh keys for root | ||
authorized_key: user=root key="{{ item }}" state=present | ||
authorized_key: | ||
user: root | ||
key: "{{ item }}" | ||
state: present | ||
with_file: | ||
- [email protected] | ||
- [email protected] | ||
|
||
- name: ssh keys for ubuntu | ||
authorized_key: user=ubuntu key="{{ item }}" state=present | ||
authorized_key: | ||
user: ubuntu | ||
key: "{{ item }}" | ||
state: present | ||
with_file: | ||
- [email protected] | ||
- [email protected] |