LoginSignup
1
1

More than 5 years have passed since last update.

ansibleでec2インスタンス上にjenkinsを動かしてawsebcliも使えるようにした

Last updated at Posted at 2015-05-26
- name: install python 2.7
  yum: name=python27-devel

- name: use python 2.7
  shell: ln -sf /usr/bin/python27 /usr/bin/python

- name: install pip
  shell: easy_install-2.7 pip

- name: install openjdk
  yum: name=java-1.7.0-openjdk

- name: get jenkins
  shell: wget http://pkg.jenkins-ci.org/redhat/jenkins-1.614-1.1.noarch.rpm -O jenkins.rpm && rpm -ivh jenkins.rpm
  args:
    creates: jenkins.rpm

- name: run jenkins
  shell: service jenkins restart

- name: create directory for aws credential file
  file: path=/var/lib/jenkins/.aws state=directory owner=jenkins group=jenkins mode=0755

- name: copy aws credential file to remote server
  copy: src=credentials dest=/var/lib/jenkins/.aws/credentials mode=0755

- name: copy aws config file to remote server
  copy: src=config dest=/var/lib/jenkins/.aws/config mode=0755

- name: install eb for jenkins
  shell: /usr/local/bin/pip install --upgrade awsebcli

新しめのamazon linuxはpython2.7が最初から動くようなので、最初の3つぐらいはいらないかもしれません。

credentials及びconfigファイルは、ansibleのしかるべき場所(roles/hoge/files)に置いてあります。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1