From 7ae6c81de837c281c9b436d46bf4481bd6cd57f7 Mon Sep 17 00:00:00 2001 From: William Yeh Date: Mon, 4 Jan 2016 16:51:33 +0800 Subject: [PATCH] Fix: install httplib2 for GCE's Ubuntu 14.04 instances. --- 05-success/README.md | 10 ++++++++++ 05-success/hosts-azure | 3 +++ 05-success/hosts-ec2 | 6 ++++++ 05-success/hosts-gce | 6 ++++++ 05-success/init-wordpress.yml | 8 +++++++- 06-ci/init-wordpress.yml | 8 +++++++- 10-role/init-wordpress.yml | 8 +++++++- 11-galaxy/init-wordpress.yml | 8 +++++++- 8 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 05-success/hosts-azure create mode 100644 05-success/hosts-ec2 create mode 100644 05-success/hosts-gce diff --git a/05-success/README.md b/05-success/README.md index fb3f2b3..0ba6517 100644 --- a/05-success/README.md +++ b/05-success/README.md @@ -18,12 +18,22 @@ Common stages: - initialize, update, rollback +### Be open for surprise... + +Different IaaS/VM providers may have different pre-installed packages. For example, even with the same "Ubuntu 14.04 LTS" VM image: + +- In Vagrant box [`ubuntu/trusty64`](https://atlas.hashicorp.com/ubuntu/boxes/trusty64), the Python library `httplib2` is pre-installed. +- In Google Compute Engine `Ubuntu 14.04 LTS` (amd64 trusty image built on 2015-11-13), the Python library `httplib2` is *not* pre-installed. + + ### 用到的 module(s) - Files modules / [template](http://docs.ansible.com/ansible/template_module.html): Templates a file out to a remote server. - System modules / [service](http://docs.ansible.com/ansible/service_module.html): Manage services. +- Packaging modules / [apt](http://docs.ansible.com/ansible/apt_module.html): Manages apt-packages. + - Network modules / [uri](http://docs.ansible.com/uri_module.html): Interacts with webservices. diff --git a/05-success/hosts-azure b/05-success/hosts-azure new file mode 100644 index 0000000..32b3850 --- /dev/null +++ b/05-success/hosts-azure @@ -0,0 +1,3 @@ +[azure-host] +111.222.333.444 + diff --git a/05-success/hosts-ec2 b/05-success/hosts-ec2 new file mode 100644 index 0000000..e427158 --- /dev/null +++ b/05-success/hosts-ec2 @@ -0,0 +1,6 @@ +# ec2-host + +[wordpress] +111.111.111.111 ansible_ssh_user=ubuntu +#111.111.111.111 ansible_user=ubuntu + diff --git a/05-success/hosts-gce b/05-success/hosts-gce new file mode 100644 index 0000000..b70a687 --- /dev/null +++ b/05-success/hosts-gce @@ -0,0 +1,6 @@ +# gce-host + +[wordpress] +mywordpress ansible_ssh_host=104.0.0.100 +#mywordpress ansible_host=104.0.0.100 + diff --git a/05-success/init-wordpress.yml b/05-success/init-wordpress.yml index 642d190..ebd2e2d 100644 --- a/05-success/init-wordpress.yml +++ b/05-success/init-wordpress.yml @@ -10,7 +10,13 @@ blog_email: foo@gmail.com tasks: - - name: ==> 12 - automate the '5-minute install' process + - debug: ==> 12 - automate the '5-minute install' process + + - name: install dependency - httplib2 + apt: name=python-httplib2 state=present + #pip: name=httplib2 + + - name: send POST to WordPress install wizard uri: url: "{{ wordpress_install_url }}" method: POST diff --git a/06-ci/init-wordpress.yml b/06-ci/init-wordpress.yml index 642d190..ebd2e2d 100644 --- a/06-ci/init-wordpress.yml +++ b/06-ci/init-wordpress.yml @@ -10,7 +10,13 @@ blog_email: foo@gmail.com tasks: - - name: ==> 12 - automate the '5-minute install' process + - debug: ==> 12 - automate the '5-minute install' process + + - name: install dependency - httplib2 + apt: name=python-httplib2 state=present + #pip: name=httplib2 + + - name: send POST to WordPress install wizard uri: url: "{{ wordpress_install_url }}" method: POST diff --git a/10-role/init-wordpress.yml b/10-role/init-wordpress.yml index 642d190..ebd2e2d 100644 --- a/10-role/init-wordpress.yml +++ b/10-role/init-wordpress.yml @@ -10,7 +10,13 @@ blog_email: foo@gmail.com tasks: - - name: ==> 12 - automate the '5-minute install' process + - debug: ==> 12 - automate the '5-minute install' process + + - name: install dependency - httplib2 + apt: name=python-httplib2 state=present + #pip: name=httplib2 + + - name: send POST to WordPress install wizard uri: url: "{{ wordpress_install_url }}" method: POST diff --git a/11-galaxy/init-wordpress.yml b/11-galaxy/init-wordpress.yml index 642d190..ebd2e2d 100644 --- a/11-galaxy/init-wordpress.yml +++ b/11-galaxy/init-wordpress.yml @@ -10,7 +10,13 @@ blog_email: foo@gmail.com tasks: - - name: ==> 12 - automate the '5-minute install' process + - debug: ==> 12 - automate the '5-minute install' process + + - name: install dependency - httplib2 + apt: name=python-httplib2 state=present + #pip: name=httplib2 + + - name: send POST to WordPress install wizard uri: url: "{{ wordpress_install_url }}" method: POST