From c8aa64d7596337efac91828d47a0f1d2f1a8cdff Mon Sep 17 00:00:00 2001 From: Nikola Vidovic Date: Fri, 26 Sep 2014 11:04:10 +0200 Subject: [PATCH] Create deploy playbook - Add deploy user, set profile and lock it. - Add profile file. Fixes #2 Fixes #3 Closes #30 --- playbooks/bootstrap.yml | 2 ++ playbooks/deploy.yml | 13 +++++++++++++ playbooks/files/profile | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 playbooks/deploy.yml create mode 100644 playbooks/files/profile diff --git a/playbooks/bootstrap.yml b/playbooks/bootstrap.yml index b119a15..ad5b8a0 100644 --- a/playbooks/bootstrap.yml +++ b/playbooks/bootstrap.yml @@ -65,3 +65,5 @@ - name: Save public key to authorized keys get_url: url=https://github.com/rxaviers.keys dest=/root/.ssh/authorized_keys mode=700 + + - include: deploy.yml diff --git a/playbooks/deploy.yml b/playbooks/deploy.yml new file mode 100644 index 0000000..920615b --- /dev/null +++ b/playbooks/deploy.yml @@ -0,0 +1,13 @@ +--- + + - name: Create deploy user + user: name=deploy shell=/bin/bash home=/srv + + - name: Lock user deploy + shell: usermod -L deploy + + - name: Create srv folder + file: path=/srv owner=deploy state=directory + + - name: Set profile for deploy user + copy: src=files/profile dest=/srv/.profile diff --git a/playbooks/files/profile b/playbooks/files/profile new file mode 100644 index 0000000..59aacfb --- /dev/null +++ b/playbooks/files/profile @@ -0,0 +1,2 @@ +PS1='\[\033[01;35m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' +alias ls="ls --color=auto"