blob: e5916da51b259be186485645695b3db46830cebf [file] [log] [blame]
Luca Pretec97ad882018-05-04 11:22:14 -07001---
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Luca Pretec97ad882018-05-04 11:22:14 -070015
16- hosts: all
17 gather_facts: False
18
19 tasks:
20 - name: Update apt-get
21 raw: sudo apt-get update -qq
Zack Williams11b2e5c2018-05-18 09:50:54 -070022 tags:
23 - skip_ansible_lint # raw command in prep for python install
Luca Pretec97ad882018-05-04 11:22:14 -070024
25 - name: Install python 2.7
26 raw: sudo apt-get install -qq python2.7
Zack Williams11b2e5c2018-05-18 09:50:54 -070027 tags:
28 - skip_ansible_lint # raw command to install python
Luca Pretec97ad882018-05-04 11:22:14 -070029
30 - name: Install prerequisites for using PPA repos
31 apt:
32 name: "{{ item }}"
33 update_cache: yes
34 cache_valid_time: 3600
35 with_items:
36 - python-pycurl
37 - software-properties-common
38 - python-netaddr
Zack Williamsd8998342019-02-05 10:20:31 -070039 register: task_result
40 until: task_result is success
41 retries: 3
42 delay: 5
Luca Pretec97ad882018-05-04 11:22:14 -070043
44 - name: Add Ansible PPA
45 apt_repository:
46 repo={{ item }}
47 with_items:
48 - "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}"
Zack Williamsd8998342019-02-05 10:20:31 -070049 register: task_result
50 until: task_result is success
Luca Pretec97ad882018-05-04 11:22:14 -070051 retries: 3
Zack Williamsd8998342019-02-05 10:20:31 -070052 delay: 5
Luca Pretec97ad882018-05-04 11:22:14 -070053
54 - name: Make sure Ansible is newest version
55 apt:
56 name: "ansible"
Luca Pretec97ad882018-05-04 11:22:14 -070057 update_cache: yes
58 cache_valid_time: 3600
Zack Williamsd8998342019-02-05 10:20:31 -070059 register: task_result
60 until: task_result is success
61 retries: 3
62 delay: 5
Luca Pretec97ad882018-05-04 11:22:14 -070063
64 - name: Enable ip forwarding
65 sysctl:
66 name: 'net.ipv4.ip_forward'
67 value: 1
68 sysctl_set: True
69 state: present
70 reload: yes
71
72 - name: Remove swapfile from /etc/fstab
73 mount:
74 name: swap
75 fstype: swap
76 state: absent
77
78 - name: Disable swap
Zack Williams11b2e5c2018-05-18 09:50:54 -070079 command: "swapoff -a"
80 tags:
81 - skip_ansible_lint # there isn't a module for this, command is idempotent
82