Cleaned up task and added removing ipv6 from host file.
diff --git a/tasks/main.yml b/tasks/main.yml
index dafa9cd..5dbeb71 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,6 +1,37 @@
---
# 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
+
+- name: Remove IPv6 localhost entry
+ replace:
+ dest: /etc/hosts
+ regexp: '::1.*(localhost6.*)$'
+ replace: '::1 \1'
+
+- name: Create pip config folder
+ file:
+ path: "{{ pip_conf_dir }}"
+ state: directory
+ when: pip_conf_dir is defined
+
+- name: Configure pip
+ template:
+ src: pip.conf.j2
+ dest: "{{ pip_conf_dir }}/pip.conf"
+ when: pip_conf_dir is defined and pip_index_url is defined
+
- name: Do not use proxy definitions
include: with_no_proxy.yml
when: http_proxy is not defined and https_proxy is not defined
@@ -8,3 +39,34 @@
- name: Use proxy definitions
include: with_proxy.yml
when: http_proxy is defined and https_proxy is defined
+
+- name: Start rngd service
+ service:
+ name: rngd
+ enabled: yes
+ state: started
+
+- name: Update vm.swappiness
+ become: yes
+ sysctl:
+ name: vm.swappiness
+ value: '{{ vm_swappiness }}'
+ state: present
+
+- name: Disable Default IPV6
+ become: yes
+ shell: "sysctl -w net.ipv6.conf.default.disable_ipv6=1"
+ tags: ['ipv6']
+
+- name: Disable All IPV6
+ become: yes
+ shell: "sysctl -w net.ipv6.conf.all.disable_ipv6=1"
+ tags: ['ipv6']
+
+- name: Update for apigee installation environment
+ become: yes
+ lineinfile:
+ dest: /etc/environment
+ regexp: "^export CONTINUE_ON_WARNING="
+ line: 'export CONTINUE_ON_WARNING={{ apigee_continue_on_warning }}'
+ backup: yes
diff --git a/tasks/with_no_proxy.yml b/tasks/with_no_proxy.yml
index d3771bd..fb5df9a 100644
--- a/tasks/with_no_proxy.yml
+++ b/tasks/with_no_proxy.yml
@@ -1,19 +1,6 @@
---
---
# 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
-
- name: Update basic yum os packages
become: yes
yum:
@@ -39,49 +26,6 @@
- sed
- unzip
-- name: Start rngd service
- service:
- name: rngd
- enabled: yes
- state: started
-
-- name: Update vm.swappiness
- become: yes
- sysctl:
- name: vm.swappiness
- value: '{{ vm_swappiness }}'
- state: present
-
-- name: Disable Default IPV6
- become: yes
- shell: "sysctl -w net.ipv6.conf.default.disable_ipv6=1"
- tags: ['ipv6']
-
-- name: Disable All IPV6
- become: yes
- shell: "sysctl -w net.ipv6.conf.all.disable_ipv6=1"
- tags: ['ipv6']
-
-- name: Update for apigee installation environment
- become: yes
- lineinfile:
- dest: /etc/environment
- regexp: "^export CONTINUE_ON_WARNING="
- line: 'export CONTINUE_ON_WARNING={{ apigee_continue_on_warning }}'
- backup: yes
-
-- name: Create pip config folder
- file:
- path: "{{ pip_conf_dir }}"
- state: directory
- when: pip_conf_dir is defined
-
-- name: Configure pip
- template:
- src: pip.conf.j2
- dest: "{{ pip_conf_dir }}/pip.conf"
- when: pip_conf_dir is defined and pip_index_url is defined
-
- name: Download pip package manager
become: yes
tags: ['pip-manager']
diff --git a/tasks/with_proxy.yml b/tasks/with_proxy.yml
index 41150fc..39ae42f 100644
--- a/tasks/with_proxy.yml
+++ b/tasks/with_proxy.yml
@@ -1,18 +1,4 @@
---
-
-- 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
-
- name: Update basic yum os packages
become: yes
yum:
@@ -41,49 +27,6 @@
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
-- name: Start rngd service
- service:
- name: rngd
- enabled: yes
- state: started
-
-- name: Update vm.swappiness
- become: yes
- sysctl:
- name: vm.swappiness
- value: '{{ vm_swappiness }}'
- state: present
-
-- name: Disable Default IPV6
- become: yes
- shell: "sysctl -w net.ipv6.conf.default.disable_ipv6=1"
- tags: ['ipv6']
-
-- name: Disable All IPV6
- become: yes
- shell: "sysctl -w net.ipv6.conf.all.disable_ipv6=1"
- tags: ['ipv6']
-
-- name: Update for apigee installation environment
- become: yes
- lineinfile:
- dest: /etc/environment
- regexp: "^export CONTINUE_ON_WARNING="
- line: 'export CONTINUE_ON_WARNING={{ apigee_continue_on_warning }}'
- backup: yes
-
-- name: Create pip config folder
- file:
- path: "{{ pip_conf_dir }}"
- state: directory
- when: pip_conf_dir is defined
-
-- name: Configure pip
- template:
- src: pip.conf.j2
- dest: "{{ pip_conf_dir }}/pip.conf"
- when: pip_conf_dir is defined and pip_index_url is defined
-
- name: Download pip package manager
become: yes
tags: ['pip-manager']