forked from JNPRAutomate/ansible-junos-evpn-vxlan
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pb.server.setup.yaml
61 lines (53 loc) · 1.5 KB
/
pb.server.setup.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
- name: Configure Servers
hosts: server
become: true
vars:
ansible_python_interpreter: /usr/bin/python
tasks:
- name: Set Hostname
hostname: name={{ inventory_hostname }}
##########################################
### Update User Account
##########################################
- name: Add password for user UBUNTU
user:
name: ubuntu
password: $6$AaIDkR2Gy$CpjSw.1OTou23E/Cy6qX.Ayniyx7d2r0Ou/tM1TMOCmlX0mahq4whlvfv9QGsnQ3PWY0LlRTQ3Sz3EyyiUp3u1
tags: [ pwd ]
- name: Update SSH conf to allow password
lineinfile:
dest: /etc/ssh/sshd_config
state: absent
regexp: "^PasswordAuthentication no"
become: true
tags: [ pwd ]
- name: Reload SSHD config
service: name=ssh state=reloaded
tags: [ pwd ]
##########################################
### Configure ETH1
##########################################
- name: Configure Additional Interfaces
template:
src: templates/ubuntu.eth.cfg.j2
dest: "/etc/network/interfaces.d/{{ item.int }}.cfg"
with_items: "{{ interfaces }}"
tags: [ int ]
- name: Restart Interfaces (down)
command: ifdown {{ item.int }}
become: true
with_items:
- int: eth1
tags: [ int ]
- name: Restart Interfaces (up)
command: ifup {{ item.int }}
become: true
with_items:
- int: eth1
tags: [ int ]
- name: Test Spine Reacheability
command: 'ping -c 4 {{ item }}'
changed_when: false
with_items: [ 10.0.6.11, 10.0.6.12 ]
tags: [ ping ]