Nate Stephany
2020-01-14 6836a5f75cc9d65f9dcb1e9ecde7aaf6dadbeccb
commit | author | age
6b9f19 1 #vim: set ft=ansible:
NS 2 ---
3 # tasks file for bastion
4
5 - name: copy the user's SSH private key
6   become: true
7   copy:
8     src: "~/.ssh/{{key_name}}.pem"
9     dest: "/root/.ssh/{{key_name}}.pem"
10     owner: root
11     group: root
12     mode: 0400
13   when: not use_own_key|bool
14   tags:
15     - copy_env_private_key
16
17 - name: Generate host .ssh/config Template
18   become: no
19   local_action: template src={{ role_path }}/files/bastion_ssh_config.j2 dest={{output_dir}}/ssh-config-{{ env_type }}-{{ guid }}
20   tags:
21     - gen_sshconfig_file
22
23 - name: copy over host .ssh/config Template
24   become: true
25   copy:
26     src: "{{output_dir}}/ssh-config-{{ env_type }}-{{ guid }}"
27     dest: /root/.ssh/config
28     owner: root
29     group: root
30     mode: 0400
31   tags:
32     - copy_sshconfig_file
33
34 - name: Install python-requests
35   ignore_errors: yes
36   become: true
37   yum:
38     name:
39     - python-requests
40   when: not hostvars.localhost.skip_packer_tasks | d(false)
41   tags: packer
42
43 - name: Stat /etc/sysconfig/iptables
44   stat:
45     path: /etc/sysconfig/iptables
46   register: statiptables
47
48 - name: Install FTL
6836a5 49   when: >-
NS 50     install_ftl | d(False) | bool or
51     ftl_injector_tag is defined
6b9f19 52   block:
NS 53   - name: Install FTL
54     include_role:
55       name: ftl-injector
56     vars:
57       student_login: "{{ student_name }}"
c8c598 58       use_python3: "{{ ftl_use_python3 | default(true) }}"
6b9f19 59
NS 60 - name: Install jq on the bastion
61   get_url:
62     url: https://gpte-public.s3.amazonaws.com/jq-linux64
63     dest: /usr/bin/jq
64     mode: 0775
65     owner: root
66     group: root
67
68 - name: Install stern (multi-pod logging tool) on the bastion
69   get_url:
2b0c4b 70     url: https://gpte-public.s3.amazonaws.com/stern_linux_amd64
6b9f19 71     dest: /usr/bin/stern
NS 72     mode: 0775
73     owner: root
74     group: root