remove apache python script. remove nodesource and use official node.js distribution download

This commit is contained in:
Jeff Steinmetz 2015-11-25 23:09:00 -08:00
parent 0b169a6d7c
commit 97a581954f
5 changed files with 18 additions and 91 deletions

View file

@ -18,14 +18,18 @@
# Assumes Java 7+ jdk installed
---
- name: get apache maven mirror location
script: apache-mirror-selector.py http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
register: mavenURL
- name: Install pythons httplib2 library so that ansible uri module works
apt: pkg=python-httplib2 state=present
- debug: var=mavenURL.stdout_lines[0]
- name: Call apache web service to find preferred maven download mirror
uri: url=http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz&asjson=1 return_content=yes
register: webResponse
#- debug: var=webResponse
- name: download maven
get_url: url="{{mavenURL.stdout_lines[0]}}"
get_url: url="{{webResponse.json.preferred}}{{webResponse.json.path_info}}"
dest=/tmp/apache-maven-3.3.3-bin.tar.gz
mode=0440
validate_certs=False

View file

@ -1,21 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# Pin-Priority of NodeSource repository
nodejs_nodesource_pin_priority: 500
# 0.10 or 0.12 or 4.x
nodejs_version: "0.12"

View file

@ -13,37 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Install Node.js via NodeSource
# Install Node.js from the official Node.js
---
- name: Install HTTPS transport for APT
apt:
pkg: apt-transport-https
state: installed
- name: Download official Linux x64 distribution from Node.js
get_url: url=http://nodejs.org/dist/v0.12.8/node-v0.12.8-linux-x64.tar.gz dest=/tmp/node-v0.12.8-linux-x64.tar.gz
- name: Import the NodeSource GPG key into apt
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present
- name: Add NodeSource deb repository
apt_repository:
repo: 'deb https://deb.nodesource.com/node_{{ debian_repo_version }} {{ ansible_distribution_release }} main'
state: present
- name: Add NodeSource deb-src repository
apt_repository:
repo: 'deb-src https://deb.nodesource.com/node_{{ debian_repo_version }} {{ ansible_distribution_release }} main'
state: present
- name: Add NodeSource repository preferences
template:
src: deb_nodesource_com_node.pref.2
dest: /etc/apt/preferences.d/deb_nodesource_com_node.pref
- name: Unpack node
unarchive: src=/tmp/node-v0.12.8-linux-x64.tar.gz dest=/tmp/ copy=no
- name: Install Node.js
apt:
pkg:
- nodejs={{ nodejs_version }}*
state: installed
update_cache: yes
command: tar -C /usr/local --strip-components 1 -xzf /tmp/node-v0.12.8-linux-x64.tar.gz
args:
creates: /usr/local/bin/node

View file

@ -1,18 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Package: *
Pin: release o=Node Source
Pin-Priority: {{ nodejs_nodesource_pin_priority }}

View file

@ -1,18 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# vars file for nodejs
debian_repo_version: "{{ nodejs_version if '4' not in nodejs_version else '4.x' }}"