Giter Club home page Giter Club logo

ansible-role-apt's Introduction

Ansible Role: Apt Build Status

This role will add third party sources to the package manager by:

  • Adding source URL as new repository
  • Adding secure key specified
  • Managing packages preferences files (aka. pinning)
  • Installing packages

It's part of the Manala Ansible stack but can be used as a stand alone component.

Requirements

None.

Dependencies

None.

Installation

Ansible 2+

Using ansible galaxy cli:

ansible-galaxy install manala.apt

Using ansible galaxy requirements file:

- src: manala.apt

Role Handlers

None

Role Variables

Definition

Name Default Type Description
manala_apt_components ['main'] Array Collection of components
manala_apt_sources_list [] Array Collection of sources
manala_apt_repositories [] Array Collection of repositories
manala_apt_preferences [] Array Collection of preferences
manala_apt_packages [] Array Collection of packages

Example

- hosts: all
  vars:
    manala_apt_repositories:
      - contrib
    manala_apt_preferences:
      - git@debian_backports
      - dotdeb:100
      - php@dotdeb_php56:300
      - nginx@nginx
    manala_apt_packages:
      - ttf-mscorefonts-installer
  roles:
    - role: manala.apt

Components

Specify apt components

manala_apt_components: ['main', 'contrib', 'non-free']

Sources list

Define manually each sources

manala_apt_sources_list:
  - deb: http://httpredir.debian.org/debian wheezy main
  - deb http://httpredir.debian.org/debian wheezy contrib

Or use predefined templates

manala_apt_sources_list_template: sources_list/debian.j2

Or combine both

manala_apt_sources_list_template: sources_list/debian_src.j2
manala_apt_sources_list:
  - deb-src: http://httpredir.debian.org/debian wheezy main
  - deb-src http://httpredir.debian.org/debian wheezy contrib

Repositories

Concise, pattern based

manala_apt_repositories:
  - debian_security
  - debian_security_src
  - debian_updates
  - debian_updates_src
  - debian_backports
  - ubuntu_security
  - ubuntu_updates
  - ubuntu_partner
  - ubuntu_backports
  - dotdeb
  - dotdeb_php54
  - dotdeb_php55
  - dotdeb_php56
  - nginx
  - bearstech
  - nodesource_0_10
  - nodesource_0_12
  - nodesource_4
  - postgresql
  - mongodb_3_0
  - mongodb_3_1
  - varnish_4_0
  - jenkins
  - sensu
  - rabbitmq
  - proxmox
  - proxmox_enterprise
  - logentries
  - galera
  - grafana
  - elasticsearch_1_5
  - elasticsearch_1_6
  - elasticsearch_1_7
  - ppa_ansible
  - blackfire

Verbose, pattern based

manala_apt_repositories:
  - pattern: debian_backports
    state:   absent

Verbose

manala_apt_repositories:
  - source: deb http://pkg.jenkins-ci.org/debian binary/
    key:
      url: http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key
      id:  D50582E6
  - source: deb https://enterprise.proxmox.com/debian {{ ansible_distribution_release }} pve-enterprise
    state:  absent

Exclusivity (all repositories non defined by role will be deleted)

manala_apt_repositories_exclusive: true

Preferences

Concise, pattern based

Format: [preference pattern]@[repository pattern]:[pin priority]

Note that referenced repositories will automatically be include as present using "manala_apt_repositories" process.

manala_apt_preferences:
  - git@debian_backports         # "git*"" from debian backports repository, high priority
  - dotdeb:100                   # "*" from dotdeb repository, low priority
  - php@dotdeb                   # "php*" from dotdeb repository, high priority
  - redis@dotdeb                 # "redis*" from dotdeb repository, high priority
  - libssl1.0.0@debian_backports # "libssl1.0.0" from debian backports repository, high priority (in this case "libssl1.0.0" is not a pre-defined preference pattern; as a matter of consequence the package is directly used)

Verbose

manala_apt_preferences:
  - package:  '*'
    pin: release o=Debian,a=stable
    priority: 600
    file:     dotdeb
  - package:  'php-*'
    pin:      release o=Debian,a=stable
    priority: 900
    file:     php      

Packages

Concise

manala_apt_packages:
  - vim # Name of package

Verbose

manala_apt_packages:
  - name:  bzip2  # Name of package, required
    state: absent # State of package, optionnal, default 'present'
    force: true   # Force installation, optionnal

Licence

MIT

Author information

Manala (http://www.manala.io/)

ansible-role-apt's People

Contributors

chalasr avatar gfaivre avatar hyvs avatar nervo avatar woecifaun avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.