blob: a34b68f7f32e1472473e3843f14d85fb09218ca0 [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.
15#
16
17- hosts: all
18 gather_facts: False
19
20 tasks:
21 - name: Update apt-get
22 raw: sudo apt-get update -qq
23
24 - name: Install python 2.7
25 raw: sudo apt-get install -qq python2.7
26
27 - name: Install prerequisites for using PPA repos
28 apt:
29 name: "{{ item }}"
30 update_cache: yes
31 cache_valid_time: 3600
32 with_items:
33 - python-pycurl
34 - software-properties-common
35 - python-netaddr
36
37 - name: Add Ansible PPA
38 apt_repository:
39 repo={{ item }}
40 with_items:
41 - "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}"
42 register: result
43 until: result | success
44 retries: 3
45 delay: 10
46
47 - name: Make sure Ansible is newest version
48 apt:
49 name: "ansible"
50 state: latest
51 update_cache: yes
52 cache_valid_time: 3600
53
54 - name: Enable ip forwarding
55 sysctl:
56 name: 'net.ipv4.ip_forward'
57 value: 1
58 sysctl_set: True
59 state: present
60 reload: yes
61
62 - name: Remove swapfile from /etc/fstab
63 mount:
64 name: swap
65 fstype: swap
66 state: absent
67
68 - name: Disable swap
69 command: swapoff -a