Coder Social home page Coder Social logo

ansible-role-ansible-pull's Introduction

Ansible Pull

Galaxy

Configure a remote machine to run ansible-pull on a schedule. ansible will be installed on the managed node in a virtual environment using pip.

Requirements

  • cron
  • logrotate

Role Variables

At a minimum, you need to define ansible_pull_repo where your Ansible playbook repository lives as well as the ansible_pull_playbook to run.

Name Default Value Description
ansible_pull_workdir /var/lib/ansible/local Directory where repository is cloned.
ansible_pull_repo https://github.com/samdoran/demo-playbooks.git Remote repository to clone when running ansible-pull.
ansible_pull_playbook {{ ansible_pull_workdir }}/hello.yml Playbook to run with ansible-pull.
ansible_pull_logfile /var/log/ansible-pull.log Where to log output from ansible-pull. Also gets rotated.
ansible_pull_vault_password_file /root/.vault File to hold Ansible vault key. Not recommonded unless you aware of the implications of storing keys in clear text on remote hosts, or you are using a script to get the secret from an external source.
ansible_pull_vault_password SuperSecretKey Vault key, in plain text, that will be inserted int ansible_pull_vault_password_file. Not recommonded unless you aware of the implications of storing keys in clear text on remote hosts, or you are using a script to get the secret from an external source.
ansible_pull_ssh_private_key [see defaults/main.yml] Optionally define an SSH private key that will be installed for root on the remote host. If this is not defined, a new key will be generated and the public SSH key will be output at the end of the play.
ansible_known_hosts [] List of SSH host keys to add to /root/.ssh/known_hosts.
ansible_pull_cron_jobs [see defaults/main.yml] Cron configuration for jobs that run ansible-pull. The default settings run ansible-pull every ten minutes.
ansible_pull_user root User that will run ansible-pull.
ansible_pull_pip_packages ['ansible'] List of Python packages to install in the virtual environment.

Dependencies

  • samdoran.repo_epel

Example Playbook

Here is a playbook using an internal GitLab server with the pull.yml playbook. We also set the SSH key of the internal GitLab server to avoid any problems.

- name: Setup Ansible Pull
  hosts: all
  become: True

  vars:
    ansible_pull_playbook: "{{ ansible_pull_workdir }}/playbooks/pull.yml"
    ansible_pull_repo: "[email protected]/internal.git"
    ansible_pull_known_hosts:
      - name: "gitlab.acme.com"
        state: present
        key: "gitlab.acme.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCEPm0nPQBk+W4FBWSuI2wP0vO2W5cfDQV3B65WayiQPCh5kQIaTfDaRXIHACu9GcZRx5mhTsXYt+jY2egvLwazX5xvvQqDZX7wLw+qJXnpb1pqS7koINnAopGspp5v/+KPk7e3SRbLdNDk8O/g7uXb1PwaryebQM2+eluDebh1zbDd2QgKHf1/p4gZ66m4QJ9s17+Qzj3AJO+5fNr9z0MxPkYkf3jLvJ8PmAqGT+6AYlAh889yCrrC+yGj7VH/H6P3dEakj2xEx3Ib4g42EjKOpumoCVLY6dKrtSlkyOVBEOkf7G3liIV2ZNm6smWsJsnCTMPy4o9ioxF+x5GG1nsL"

  roles:
    - samdoran.repo_epel
    - samdoran.ansible_pull

License

Apache 2.0

ansible-role-ansible-pull's People

Contributors

doomhammer avatar justin8 avatar samdoran 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.