Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (45 sloc) 1.68 KB
# coding:utf-8
# for Amazon Linux
- hosts: all
remote_user: ec2-user
sudo: yes
gather_facts: no
tasks:
- name: locale setting
shell: 'sudo cp -p /usr/share/zoneinfo/Japan /etc/localtime'
- name: upgrade all packages
yum: name=* state=latest
# Tools isntall
- name: install git
yum: name=git disable_gpg_check=no state=installed
# Docker install
- name: install docker
yum: name=docker-io disable_gpg_check=no state=installed
- name: start docker
service: name=docker enabled=yes state=started
- name: dockere commnad can execute all user.
shell: 'chmod +s /usr/bin/docker'
# Jeknins install
- name: yum jdk install for jenkins
yum: name=java-1.8.0-openjdk-headless state=installed
- name: jenkins repository install
shell: 'curl http://pkg.jenkins-ci.org/redhat/jenkins.repo > /etc/yum.repos.d/jenkins.repo'
- name: jenkins key install
shell: 'rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key'
- name: jenkins install
yum: name=jenkins state=installed
- name: add docker group
group: name=docker state=present
- name: jenkins user add for docker
user: name=jenkins groups=docker append=yes
- name: jenkins service set
service: name=jenkins enabled=yes state=started
# Nginx install.
- name: install nginx
yum: name=nginx disable_gpg_check=no state=installed
- name: start nginx
service: name=nginx enabled=yes state=started
- name: setting file directory change permission.
shell: 'chmod a+w /etc/nginx/default.d/'
- name: nginx command change permission.
shell: 'chmod +s /usr/sbin/nginx'