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