updated role
diff --git a/defaults/main.yml b/defaults/main.yml index 5f10a8d..a410afe 100644 --- a/defaults/main.yml +++ b/defaults/main.yml
@@ -5,17 +5,7 @@ # Default value to limit swap file use vm_swappiness: 60 -# Default epel repo for OracleLinux 6 -epel_rhel6: http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm - -# Default epel repo for RHEL 7 -epel_rhel7: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - -# Default epel repo for RHEL 6 -#epel_rhel6: https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm - qpid_client: ftp://fr2.rpmfind.net/linux/epel/7/x86_64/q/qpid-cpp-client-1.35.0-3.el7.x86_64.rpm - qpid_server: ftp://fr2.rpmfind.net/linux/epel/7/x86_64/q/qpid-cpp-server-1.35.0-3.el7.x86_64.rpm pip_packages: @@ -46,4 +36,4 @@ - unzip - openldap-clients-2.4.40 - openldap-servers-2.4.40 -- openldap-2.4.40 \ No newline at end of file +- openldap-2.4.40
diff --git a/tasks/main.yml b/tasks/main.yml index a624790..df6b151 100644 --- a/tasks/main.yml +++ b/tasks/main.yml
@@ -1,9 +1,9 @@ --- # 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', '>') +- 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 @@ -12,7 +12,13 @@ - 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: @@ -34,9 +40,52 @@ include: with_proxy.yml when: http_proxy is defined and https_proxy is defined -- name: Update python packages +- name: Patch rngd service unit + replace: + dest: /usr/lib/systemd/system/rngd.service + regexp: ^(ExecStart=/sbin/rngd -f)$ + replace: \1 -r /dev/urandom + register: rngd_unit + +- name: Reload systemd + command: systemctl daemon-reload + when: rngd_unit.changed + +- name: Restart and enable rngd + service: + name: rngd + state: restarted + enabled: yes + when: rngd_unit.changed + +- name: Start and enable rngd + service: + name: rngd + state: started + enabled: yes + when: not rngd_unit.changed + +- name: Update vm.swappiness become: yes - pip: - name: '{{ item }}' + sysctl: + name: vm.swappiness + value: '{{ vm_swappiness }}' state: present - with_items: "{{ pip_packages }}" + +- 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_proxy.yml b/tasks/with_proxy.yml index fb55b94..43d1054 100644 --- a/tasks/with_proxy.yml +++ b/tasks/with_proxy.yml
@@ -1,4 +1,12 @@ --- +- name: Yum update with proxy + yum: + name: '*' + state: latest + environment: + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + no_proxy: "{{ no_proxy }}" - name: Update basic yum os packages with proxy become: yes @@ -9,6 +17,7 @@ environment: http_proxy: "{{ http_proxy }}" https_proxy: "{{ https_proxy }}" + no_proxy: "{{ no_proxy }}" - name: Start rngd service service: @@ -51,6 +60,7 @@ environment: http_proxy: "{{ http_proxy }}" https_proxy: "{{ https_proxy }}" + no_proxy: "{{ no_proxy }}" - name: Install pip package manager with proxy become: yes @@ -60,3 +70,25 @@ environment: http_proxy: "{{ http_proxy }}" https_proxy: "{{ https_proxy }}" + no_proxy: "{{ no_proxy }}" + +- name: Update pip + become: yes + pip: + name: pip + state: latest + environment: + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + no_proxy: "{{ no_proxy }}" + +- name: Update python packages with no proxy + become: yes + pip: + name: '{{ item }}' + state: present + with_items: "{{ pip_packages }}" + environment: + http_proxy: "{{ http_proxy }}" + https_proxy: "{{ https_proxy }}" + no_proxy: "{{ no_proxy }}"