Last active
December 29, 2015 03:59
-
-
Save mix3/7611961 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
--- | |
- hosts: all | |
user: vagrant | |
sudo: yes | |
vars: | |
version: 2.4.6 | |
src: /tmp | |
tasks: | |
- include: httpd_and_fcgi_with_mod_fastcgi_install.yml version=2.4.6 src=/tmp | |
- include: mysql_package_install.yml version=5.1.58-1 | |
- include: memcached_install.yml | |
- service: name=httpd state=started enabled=yes | |
- service: name=mysql state=started enabled=yes | |
- service: name=memcached state=started enabled=yes |
This file contains hidden or 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
[vagrant] | |
127.0.0.1 ansible_ssh_port=2222 | |
# [vagrant-app] | |
# 127.0.0.1 ansible_ssh_port=2223 | |
# 127.0.0.1 ansible_ssh_port=2224 | |
# 127.0.0.1 ansible_ssh_port=2225 | |
# 127.0.0.1 ansible_ssh_port=2226 | |
# [vagrant-db] | |
# 127.0.0.1 ansible_ssh_port=2227 | |
#[vagrant-app:vars] | |
# ... | |
#[vagrant-db:vars] | |
# ... | |
[vagrant:vars] | |
ansible_ssh_user=vagrant | |
ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key |
This file contains hidden or 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
--- | |
- name: install httpd httpd-devel fcgi | |
yum: name={{ item }} state=installed | |
with_items: | |
- httpd | |
- httpd-devel | |
- fcgi | |
- get_url: url=http://www.fastcgi.com/dist/mod_fastcgi-{{ version }}.tar.gz dest={{ src }} | |
- command: tar xvzf mod_fastcgi-{{ version }}.tar.gz chdir={{ src }} creates={{ src }}/mod_fastcgi-{{ version }} | |
- command: cp {{ src }}/mod_fastcgi-{{ version }}/Makefile.AP2 {{ src }}/mod_fastcgi-{{ version }}/Makefile creates={{ src }}/mod_fastcgi-{{ version }}/Makefile | |
- command: sed -i "s/\/usr\/local\/apache2/\/usr\/lib64\/httpd/" {{ src }}/mod_fastcgi-{{ version }}/Makefile | |
- command: make chdir={{ src }}/mod_fastcgi-{{ version }} | |
- command: make install chdir={{ src }}/mod_fastcgi-{{ version }} |
This file contains hidden or 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
--- | |
- name: install memcached | |
yum: name=memcached state=installed |
This file contains hidden or 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
--- | |
- get_url: url=http://downloads.mysql.com/archives/get/file/MySQL-server-community-{{ version }}.rhel5.x86_64.rpm dest={{ src }} | |
- get_url: url=http://downloads.mysql.com/archives/get/file/MySQL-client-community-{{ version }}.rhel5.x86_64.rpm dest={{ src }} | |
- get_url: url=http://downloads.mysql.com/archives/get/file/MySQL-devel-community-{{ version }}.rhel5.x86_64.rpm dest={{ src }} | |
- rpm: state=installed file={{ src }}/MySQL-server-community-{{ version }}.rhel5.x86_64.rpm | |
- rpm: state=installed file={{ src }}/MySQL-client-community-{{ version }}.rhel5.x86_64.rpm | |
- rpm: state=installed file={{ src }}/MySQL-devel-community-{{ version }}.rhel5.x86_64.rpm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ansible-playbook all_install_and_add_service.yml -i hosts -s
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
TASK: [install httpd httpd-devel fcgi] ****************************************
changed: [127.0.0.1] => (item=httpd,httpd-devel,fcgi)
TASK: [get_url url=http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz dest=/tmp] ***
changed: [127.0.0.1]
TASK: [command tar xvzf mod_fastcgi-2.4.6.tar.gz chdir=/tmp creates=/tmp/mod_fastcgi-2.4.6] ***
changed: [127.0.0.1]
TASK: [command cp /tmp/mod_fastcgi-2.4.6/Makefile.AP2 /tmp/mod_fastcgi-2.4.6/Makefile creates=/tmp/mod_fastcgi-2.4.6/Makefile] ***
changed: [127.0.0.1]
TASK: [command sed -i "s//usr/local/apache2//usr/lib64/httpd/" /tmp/mod_fastcgi-2.4.6/Makefile] ***
changed: [127.0.0.1]
TASK: [command make chdir=/tmp/mod_fastcgi-2.4.6] *****************************
changed: [127.0.0.1]
TASK: [command make install chdir=/tmp/mod_fastcgi-2.4.6] *********************
changed: [127.0.0.1]
TASK: [get_url url=http://downloads.mysql.com/archives/get/file/MySQL-server-community-5.1.58-1.rhel5.x86_64.rpm dest=/tmp] ***
changed: [127.0.0.1]
TASK: [get_url url=http://downloads.mysql.com/archives/get/file/MySQL-client-community-5.1.58-1.rhel5.x86_64.rpm dest=/tmp] ***
changed: [127.0.0.1]
TASK: [get_url url=http://downloads.mysql.com/archives/get/file/MySQL-devel-community-5.1.58-1.rhel5.x86_64.rpm dest=/tmp] ***
changed: [127.0.0.1]
TASK: [rpm state=installed file=/tmp/MySQL-server-community-5.1.58-1.rhel5.x86_64.rpm] ***
changed: [127.0.0.1]
TASK: [rpm state=installed file=/tmp/MySQL-client-community-5.1.58-1.rhel5.x86_64.rpm] ***
changed: [127.0.0.1]
TASK: [rpm state=installed file=/tmp/MySQL-devel-community-5.1.58-1.rhel5.x86_64.rpm] ***
changed: [127.0.0.1]
TASK: [install memcached] *****************************************************
changed: [127.0.0.1]
TASK: [service name=httpd state=started enabled=yes] **************************
changed: [127.0.0.1]
TASK: [service name=mysql state=started enabled=yes] **************************
ok: [127.0.0.1]
TASK: [service name=memcached state=started enabled=yes] **********************
changed: [127.0.0.1]
PLAY RECAP ********************************************************************
127.0.0.1 : ok=18 changed=16 unreachable=0 failed=0