From 0a6602e6ff0e1340331002e371f5379ef74934a8 Mon Sep 17 00:00:00 2001 From: Matt Woodson Date: Tue, 24 Feb 2015 12:55:41 -0500 Subject: cleaned up ansible tower --- lib/aws_command.rb | 2 +- playbooks/aws/ansible-tower/config.yml | 5 ++--- playbooks/aws/ansible-tower/launch.yml | 27 +-------------------------- roles/ansible/tasks/main.yaml | 7 +++++++ roles/ansible_install/tasks/main.yaml | 7 ------- roles/ansible_tower/tasks/main.yaml | 9 ++++----- 6 files changed, 15 insertions(+), 42 deletions(-) create mode 100644 roles/ansible/tasks/main.yaml delete mode 100644 roles/ansible_install/tasks/main.yaml diff --git a/lib/aws_command.rb b/lib/aws_command.rb index 0c714cdb4..44df05e6a 100644 --- a/lib/aws_command.rb +++ b/lib/aws_command.rb @@ -7,7 +7,7 @@ module OpenShift module Ops class AwsCommand < Thor # WARNING: we do not currently support environments with hyphens in the name - SUPPORTED_ENVS = %w(prod stg int twiest gshipley kint test jhonce amint tdint lint) + SUPPORTED_ENVS = %w(prod stg int ops twiest gshipley kint test jhonce amint tdint lint) option :type, :required => true, :enum => LaunchHelper.get_aws_host_types, :desc => 'The host type of the new instances.' diff --git a/playbooks/aws/ansible-tower/config.yml b/playbooks/aws/ansible-tower/config.yml index 0318d7a98..423860828 100644 --- a/playbooks/aws/ansible-tower/config.yml +++ b/playbooks/aws/ansible-tower/config.yml @@ -17,7 +17,6 @@ - "vars.{{ oo_env }}.yml" roles: - ../../../roles/base_os - - ../../../roles/timezone - - ../../../roles/ipv6_disable - - ../../../roles/ansible_install + - ../../../roles/os_ipv6_disable + - ../../../roles/ansible - ../../../roles/ansible_tower diff --git a/playbooks/aws/ansible-tower/launch.yml b/playbooks/aws/ansible-tower/launch.yml index d2938f443..4c29fa833 100644 --- a/playbooks/aws/ansible-tower/launch.yml +++ b/playbooks/aws/ansible-tower/launch.yml @@ -8,8 +8,6 @@ inst_region: us-east-1 rhel7_ami: ami-a24e30ca user_data_file: user_data.txt - oo_vpc_subnet_id: # Purposely left blank, these are here to be overridden in env vars_files - oo_assign_public_ip: # Purposely left blank, these are here to be overridden in env vars_files vars_files: - vars.yml @@ -29,30 +27,7 @@ wait: yes assign_public_ip: "{{ oo_assign_public_ip }}" vpc_subnet_id: "{{ oo_vpc_subnet_id }}" - when: oo_vpc_subnet_id - register: ec2_vpc - - - set_fact: - ec2: "{{ ec2_vpc }}" - when: oo_vpc_subnet_id - - - name: Launch instances in Classic - ec2: - state: present - region: "{{ inst_region }}" - keypair: mmcgrath_libra - group: ['Libra', '{{ oo_env }}', '{{ oo_env }}_proxy', '{{ oo_env }}_proxy_atomic'] - instance_type: c4.xlarge - image: "{{ rhel7_ami }}" - count: "{{ oo_new_inst_names | oo_len }}" - user_data: "{{ lookup('file', user_data_file) }}" - wait: yes - when: not oo_vpc_subnet_id - register: ec2_classic - - - set_fact: - ec2: "{{ ec2_classic }}" - when: not oo_vpc_subnet_id + register: ec2 - name: Add Name and environment tags to instances ec2_tag: "resource={{ item.1.id }} region={{ inst_region }} state=present" diff --git a/roles/ansible/tasks/main.yaml b/roles/ansible/tasks/main.yaml new file mode 100644 index 000000000..67a04b919 --- /dev/null +++ b/roles/ansible/tasks/main.yaml @@ -0,0 +1,7 @@ +--- +# Install ansible client + +- name: Install Ansible + yum: + pkg: ansible + state: installed diff --git a/roles/ansible_install/tasks/main.yaml b/roles/ansible_install/tasks/main.yaml deleted file mode 100644 index 67a04b919..000000000 --- a/roles/ansible_install/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Install ansible client - -- name: Install Ansible - yum: - pkg: ansible - state: installed diff --git a/roles/ansible_tower/tasks/main.yaml b/roles/ansible_tower/tasks/main.yaml index 090f0ed00..f62612eff 100644 --- a/roles/ansible_tower/tasks/main.yaml +++ b/roles/ansible_tower/tasks/main.yaml @@ -12,11 +12,10 @@ - name: download Tower setup # get_url: url=http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-{{tower_version}}.tar.gz - get_url: url=http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-2.1.1.tar.gz - dest=/opt/ force=yes + get_url: url=http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-2.1.1.tar.gz dest=/opt/ force=no - name: extract Tower - unarchive: src=/opt/ansible-tower-setup-2.1.1.tar.gz dest=/opt copy=no + unarchive: src=/opt/ansible-tower-setup-2.1.1.tar.gz dest=/opt copy=no creates=ansible-tower-setup-2.1.1 #- name: copy tower_setup_conf.yml # copy: src=tower_setup_conf.yml dest=/opt/ansible-tower-setup-2.1.1 owner=root group=root mode=0644 @@ -24,8 +23,8 @@ #- name: copy inventory # copy: src=inventory dest=/opt/ansible-tower-setup-2.1.1 owner=root group=root mode=0644 -- name: run the Tower installer - command: chdir=/opt/ansible-tower-setup-2.1.1 creates=/etc/awx/settings.py ./setup.sh +#- name: run the Tower installer +# command: chdir=/opt/ansible-tower-setup-2.1.1 creates=/etc/awx/settings.py ./setup.sh - name: Open firewalld port for http firewalld: port=80/tcp permanent=true state=enabled -- cgit v1.2.3