Skip to content

Commit

Permalink
fix warnings (#7)
Browse files Browse the repository at this point in the history
* fix typo

* modify user name

* fix warnings

* fix sudo warning
  • Loading branch information
rogerz authored and Marcin Mierzejewski committed Jul 22, 2016
1 parent a103d0c commit c35e6d7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
group_vars/server.yml
hosts
*.retry
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[defaults]
hostfile = hosts
remote_user = admin
remote_user = rogerz
2 changes: 1 addition & 1 deletion bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Bootstrap Ubuntu servers
hosts: server
sudo: yes
become: yes
roles:
- bootstrap
2 changes: 1 addition & 1 deletion collectd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Bootstrap Ubuntu servers
hosts: server
sudo: yes
become: yes
roles:
- nginx
- collectd
7 changes: 3 additions & 4 deletions reboot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
- name: Reboot server
hosts: server
sudo: yes
become: yes
roles:
- reboot
- reboot

vars_prompt:
- name: "reboot"
prompt: "Are you sure you want to reboot server (yes/no)?"
private: no
default: "no"

4 changes: 2 additions & 2 deletions roles/bootstrap/tasks/secure.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Install fail2ban
action: apt pkg=fail2ban state=installed

- name: Disallow password authentication
action: lineinfile dest=/etc/ssh/sshd_config regexp="^PasswordAuthentication" line="PasswordAuthentication no" state=present
notify: restart ssh
Expand All @@ -11,7 +11,7 @@
notify: restart ssh

- name: Delete /etc/sudoers.d/ files
action: shell rm -f /etc/sudoers.d/*
action: file path=/etc/sudoers.d/* state=absent

- name: Install packages
action: apt pkg=ufw state=installed
Expand Down
7 changes: 3 additions & 4 deletions user.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Add or update the existing user on Ubuntu servers
hosts: server
sudo: yes
become: yes
roles:
- user

vars_prompt:
- name: "username"
prompt: "Enter username"
private: no

- name: "password"
prompt: "Enter password"
encrypt: "md5_crypt"
Expand All @@ -25,4 +25,3 @@
prompt: "Add user to sudoers group (y/n)"
default: 'n'
private: no

0 comments on commit c35e6d7

Please sign in to comment.