Merge remote-tracking branch 'origin/master'

# Conflicts:
#	tasks/main.yml
#	tasks/with_no_proxy.yml
#	tasks/with_proxy.yml
diff --git a/tasks/main.yml b/tasks/main.yml
index 64869ce..5dbeb71 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,8 +1,24 @@
 ---
 # tasks file for apigee-opdk-setup-os
+
+- name: Configure AWS AMI OS package manager repositories for Apigee
+  shell: "yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional"
+  when: ansible_bios_version | lower | search('amazon') and ansible_os_family | lower == 'redhat' and ansible_distribution_major_version | version_compare('6', '>')
+
+# TODO: Look up the ansible_distribution name for RHEL systems
+#- name: If using RHEL then register RHEL on RHN
+#  shell: "subscription-manager register --username={{ rhel_user_name }} --password={{ rhel_password }} --auto-attach"
+#  when: ansible_bios_version | lower | search('amazon') and ansible_os_family | lower == 'redhat' and ansible_distribution_major_version | version_compare('7', '>')
+
 - name: Yum clean
   become: yes
-  shell: "yum clean all"
+  shell: yum clean all
+
+- name: Remove IPv6 localhost entry
+  replace:
+    dest: /etc/hosts
+    regexp: '::1.*(localhost6.*)$'
+    replace: '::1         \1'
 
 - name: Create pip config folder
   file:
@@ -18,27 +34,17 @@
 
 - name: Do not use proxy definitions
   include: with_no_proxy.yml
-  when: (https_proxy is not defined or https_proxy | trim == '') and (http_proxy is not defined or http_proxy | trim == '') and (no_proxy is not defined or no_proxy | trim == '')
+  when: http_proxy is not defined and https_proxy is not defined
 
 - name: Use proxy definitions
   include: with_proxy.yml
-  when: (https_proxy is defined or https_proxy | trim != '') and (http_proxy is defined or http_proxy | trim != '') and (no_proxy is defined or no_proxy | trim == '')
-
-- name: Update System Entropy Settings
-  lineinfile:
-    backrefs: yes
-    path: /usr/lib/systemd/system/rngd.service
-    regexp: '^(ExecStart=/sbin/rngd -f)'
-    line: '\1 -r /dev/urandom'
-
-- name: Daemon Reload
-  shell: /usr/bin/systemctl daemon-reload
+  when: http_proxy is defined and https_proxy is defined
 
 - name: Start rngd service
   service:
     name: rngd
     enabled: yes
-    state: restarted
+    state: started
 
 - name: Update vm.swappiness
   become: yes
@@ -49,21 +55,15 @@
 
 - name: Disable Default IPV6
   become: yes
-  sysctl:
-    name: net.ipv6.conf.default.disable_ipv6
-    value: 1
-    sysctl_set: yes
+  shell: "sysctl -w net.ipv6.conf.default.disable_ipv6=1"
   tags: ['ipv6']
 
 - name: Disable All IPV6
   become: yes
-  sysctl:
-    name: net.ipv6.conf.all.disable_ipv6
-    value: 1
-    sysctl_set: yes
+  shell: "sysctl -w net.ipv6.conf.all.disable_ipv6=1"
   tags: ['ipv6']
 
-- name: Update for apigee installation environment with no proxy
+- name: Update for apigee installation environment
   become: yes
   lineinfile:
     dest: /etc/environment
diff --git a/tasks/with_no_proxy.yml b/tasks/with_no_proxy.yml
index 081ea8f..fb5df9a 100644
--- a/tasks/with_no_proxy.yml
+++ b/tasks/with_no_proxy.yml
@@ -1,18 +1,32 @@
 ---
+---
 # tasks file for apigee-opdk-setup-os
-- name: Yum update with no proxy
-  yum:
-    name: '*'
-    state: latest
-
-- name: Update basic yum os packages with no proxy
+- name: Update basic yum os packages
   become: yes
   yum:
     name: "{{ item }}"
     state: present
-  with_items: "{{ yum_os_minimum_packages }}"
+  with_items:
+  - bind-utils
+  - chkconfig
+  - curl
+  - tar
+  - wget
+  - yum-utils
+  - unzip
+  - rsync
+  - which
+  - libselinux-python
+  - nss
+  - openssh-clients
+  - openssh-server
+  - grep
+  - rpm
+  - rng-tools
+  - sed
+  - unzip
 
-- name: Download pip package manager with no proxy
+- name: Download pip package manager
   become: yes
   tags: ['pip-manager']
   get_url:
@@ -20,21 +34,20 @@
     dest: /tmp/get-pip.py
   when: pip_conf_dir is not defined
 
-- name: Install pip package manager with no proxy
+- name: Install pip package manager
   become: yes
   tags: ['pip-manager']
   shell: python /tmp/get-pip.py
   when: pip_conf_dir is not defined
 
-- name: Update pip
-  become: yes
-  pip:
-    name: pip
-    state: latest
-
-- name: Update python packages with no proxy
+- name: Update python packages
   become: yes
   pip:
     name: '{{ item }}'
     state: present
-  with_items: "{{ pip_packages }}"
+  with_items:
+  - httplib2
+  - pexpect
+  - passlib
+  - requests
+  - kazoo