blob: fc66b18c5a267250a772c80b40e911ef60f0d55b [file] [log] [blame]
Gopinath Taget374a4a22017-08-16 17:04:51 -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---
18# file: ansible-install/tasks/main.yml
19
20- name: Install prerequisites for using PPA repos
21 apt:
22 name: "{{ item }}"
23 update_cache: yes
24 cache_valid_time: 3600
25 with_items:
26 - python-pycurl
27 - software-properties-common
28 - python-netaddr
29
30- name: Add Ansible PPA
31 apt_repository:
32 repo={{ item }}
33 with_items:
34 - "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}"
35 register: result
36 until: result | success
37 retries: 3
38 delay: 10
39
40- name: Make sure Ansible is newest version
41 apt:
42 name: "ansible"
43 state: latest
44 update_cache: yes
45 cache_valid_time: 3600
46 tags:
47 - skip_ansible_lint # ansible-lint complains about latest, need this as distro provided 1.5.x version may be used if already installed.