-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding deploy user playbook version 1.0
- Loading branch information
Pablo Castillo
committed
Aug 14, 2014
0 parents
commit d4dfe0d
Showing
6 changed files
with
90 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DS_Store | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
test |
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,12 @@ | ||
--- | ||
language: python | ||
python: "2.7" | ||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq python-apt python-pycurl aptitude | ||
install: | ||
- pip install ansible==1.6.6 | ||
script: | ||
- echo localhost > inventory | ||
- ansible-playbook --syntax-check -i inventory test.yml | ||
- ansible-playbook -i inventory test.yml --connection=local --sudo |
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,35 @@ | ||
# Ansible Role For A Base Linux System | ||
|
||
[![Build Status](http://img.shields.io/travis/crushlovely/ansible-linux-base.svg?style=flat)](https://travis-ci.org/crushlovely/ansible-linux-base) | ||
[![Current Version](http://img.shields.io/github/release/crushlovely/ansible-linux-base.svg?style=flat)](https://galaxy.ansible.com/list#/roles/1180) | ||
|
||
This Ansible role creates and configures a deploy user for the deployment and managemnt of applications. This was added as an example of what a users playbook should look like to deploy an application to an Ubuntu server. | ||
|
||
## Installation | ||
|
||
``` bash | ||
$ ansible-galaxy install crushlovely.deploy-user | ||
``` | ||
|
||
## Variables | ||
|
||
None | ||
|
||
## Usage | ||
|
||
Once this role is installed on your system, include it in the roles list of your playbook. | ||
|
||
``` yaml | ||
--- | ||
- hosts: localhost | ||
roles: | ||
- { role: crushlovely.deploy-user } | ||
``` | ||
|
||
## Dependencies | ||
|
||
None | ||
|
||
## License | ||
|
||
MIT |
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,14 @@ | ||
--- | ||
galaxy_info: | ||
author: Pablo Castillo | ||
company: Crush & Lovely | ||
description: Creates a deploy user for Ubuntu 12.04LTS or greater | ||
license: MIT | ||
min_ansible_version: 1.2 | ||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- precise | ||
categories: | ||
- system | ||
dependencies: [] |
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,21 @@ | ||
--- | ||
- name: Create groups | ||
group: name={{ item }} state=present | ||
with_items: | ||
- deploy | ||
|
||
- name: ensure sudoers.d is enabled | ||
lineinfile: dest=/etc/sudoers state=present backup=yes regexp='^#includedir /etc/sudoers.d' line='#includedir /etc/sudoers.d' | ||
|
||
- name: set up password-less sudo for admin users | ||
copy: content="%{{ item }} ALL=(ALL) NOPASSWD:ALL" dest="/etc/sudoers.d/{{ item }}" owner=root group=root mode=0440 | ||
with_items: | ||
- deploy | ||
|
||
- name: Create users | ||
user: name={{ item.name }} state=present group={{ item.group }} shell=/bin/bash | ||
with_items: | ||
- { name: 'deploy', group: 'deploy' } | ||
|
||
- name: Base | Take owenership of /tmp | ||
shell: sudo chown deploy:deploy /tmp |
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,3 @@ | ||
- hosts: all | ||
tasks: | ||
- include: 'tasks/main.yml' |