Skip to content

Commit

Permalink
adding deploy user playbook version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Castillo committed Aug 14, 2014
0 parents commit d4dfe0d
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
._*
.Spotlight-V100
.Trashes
test
12 changes: 12 additions & 0 deletions .travis.yml
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
35 changes: 35 additions & 0 deletions README.md
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
14 changes: 14 additions & 0 deletions meta/main.yml
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: []
21 changes: 21 additions & 0 deletions tasks/main.yml
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
3 changes: 3 additions & 0 deletions test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- hosts: all
tasks:
- include: 'tasks/main.yml'

0 comments on commit d4dfe0d

Please sign in to comment.