This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprovision.yml
61 lines (50 loc) · 2.08 KB
/
provision.yml
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
---
- name: Configuration for Stepup-VM
hosts: all
become: True
gather_facts: True
serial: 1
tasks:
- name: Set yum cache dir to /vagrant/yum/... dir (that is mounted on the host)
lineinfile: dest=/etc/yum.conf regexp=^cachedir= line=cachedir=/vagrant/yum/$basearch/$releasever
- name: Set keepcache=1
lineinfile: dest=/etc/yum.conf regexp=^keepcache= line=keepcache=1
- name: Exclude kernel packages in yum
lineinfile: dest=/etc/yum.conf regexp=^exclude=kernel line=exclude=kernel*
- name: Yum update
yum: update_cache=yes name='*' state=latest
- name: Set sshd_config MaxAuthTries 30
lineinfile: dest=/etc/ssh/sshd_config regexp=^MaxAuthTries line="MaxAuthTries 30"
- name: Restart sshd
service: name=sshd state=restarted
# Manage networking the old fashioned way
- name: Stop & Disable NetworkManager service
service: name=NetworkManager state=stopped enabled=false
- name: Create a config for ens32 in /etc/sysconfig/network-scripts/ifcfg-ens32
# ... that replaces the ifcfg-ens33 one that was overwritten by vagrant
# ens32 now survives vagrant reload / up / halt
copy:
dest: /etc/sysconfig/network-scripts/ifcfg-ens32
content: |
NAME="ens32"
DEVICE="ens32"
ONBOOT=yes
NETBOOT=yes
IPV6INIT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
NM_MANAGED=no
when: ansible_virtualization_type == "VMware"
# Always restart the network
# If something is wrong with the networking config of the VM, this is likely to show up here
- name: Restart networking
service: name=network state=restarted