2.8.4 • Published 4 years ago

ansible-ubuntu v2.8.4

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

ansible-ubuntu (vagrant)

Requires Ansible 2.9.5 or greater.

What is this?

A set of Ansible roles for Ubuntu you can npm install locally.

What's included?

RoleDescription
common/aptMake sure apt-get can work with https
common/certbotInstall certbot and create certs
common/elasticsearchInstsall elasticsearch
common/essentialsInstall some commonly used apt packages and install a .vimrc
common/gitInstall git from the git-core ppa
common/grasshopperInstall dependencies needed for the Grasshopper CMS
common/hostnameUpdate server hostname
common/infoPrint out the ubuntu version
common/javaInstall Java
common/lempInstall NGINX, MySQL, and PHP-FPM
common/list-servicesDisplay if some hard coded services are running
common/mongoInstall mongo
commmon/mysqlInstall MySQL
common/nginxInstall NGINX
common/nodeInstall Node via NVM
common/oh-my-zshInstall Oh My ZSH
common/php-fpmInstall PHP-FPM 7.2, 7.1, 7.0, or 5.6 and uninstall all other versions
common/pipInstall PIP
common/postfixInstall and lightly configure Postfix
common/rubyInstall Ruby
common/sharpInstall dependencies needed for the Sharp NPM
common/xdebugInstall xdebug for PHP 7.x

How do you use this?

npm install ansible-ubuntu

To have Ansible check node_modules/ansible-ubuntu for roles add a file called ansible.cfg into the root of your project:

[defaults]

roles_path = node_modules/ansible-ubuntu/ansible
hash_behaviour = merge

Note that the merge hash behavior allows you to override on value in a dictionary. http://docs.ansible.com/ansible/intro_configuration.html#hash-behaviour

Then create a Vagrantfile (you can use Vagrantfile.sample to get started).

In your site.yml and in your meta dirs you can refer to the ansible-ubuntu roles, e.g.:

---

- name: Setup Solid Aggregator Stack
  hosts: vagrant
  become: yes
  roles:
    - common/oh-my-zsh
    - common/elasticsearch

If you add project level roles into your directory, then they can pull in these general purpose roles as follows:

project/nginx/tasks/meta/main.yml

---
dependencies:
   - { role: 'common/nginx'}

The roles have set defaults for the variables you can modify. Just look in the defaults dir of each node.

There is a provision binary that is included. -h for help.

Once this is setup, you can just vagrant up. The initial vagrant up will also provision things. Once the box exists you can vagrant provision to reprovision.

This is not meant to be a replacement for Ansible Galaxy. This is just a suite of Ansible roles I find useful for working with Ubuntu.

Dependencies

You need vagrant and ansible installed:

http://vagrantup.com

Ansible:

sudo easy_install pip
sudo pip install ansible

Options for Specific Roles

Some of these depend on each other. You might have to add the php version to your group_vars ( php.version )

  • Certbot
    • Getting certbot to work fully automated is a little tricky, since it requires working http virtual hosts for all domain, and then you have to switch to working https configs.
    • You must fill out certbot.email
    • You must fill out certbot.domains
    • If you want to run the certbot command yourself, set certbot.create_certs to false.
  • Elasticsearch

    • For ES 5.x, you can adjust memory in /etc/elasticsearch/jvm.options: defaults: -Xms2g Xmx2g

      elasticsearch:
        bind: 127.0.0.1
        version: 5.4.1
  • Git (2.3+)

  • Grasshopper - sets up grasshopper-cli
  • Hostname

    server:
        hostname: "{{ ansible_hostname }}"
  • Java 8

  • Kibana4
  • MySQL

    mysql:
      version: 5.7

    MySQL 5.7 now binds to 127.0.0.1 by default. If you want to bind somewhere else add a linefile to modify. Example:

    lineinfile: dest=/etc/mysql/mysql.conf.d/mysqld.cnf regexp="^bind-address\s*=" line="bind-address = {{ mysql.bind }}"
  • Nginx

  • Node via Nvm

    nvm:
        version: v0.35.3
        node_version: v12.18.3
  • Oh My ZSH

    ohmyzsh:
        theme: avit
  • PHP Fpm

    • define the version you want - all others will be removed

      php:
          version: '7.2'
  • ruby (2.2)
  • Sharp - with needed libvips install

  • Mongo

    • Will skip mongo installation if mongo already installed, unless mongo.force is true.
    • Single Instance
    • Authorization enabled

      mongo:
          force: false
          journaling: "false"
          auth: "enabled"
          root_admin_name: "root"
          root_admin_password: "sample root password"
          backup_name: "backup"
          backup_password: "sample backup password"
          version: "3.4.7" # version has to be 3.0.X, 3.2.X, or 3.4.X
  • Mysql

    mysql:
        version: 5.7
        bind: 127.0.0.1
      
  • Nginx

    • If you want to use the nginx.conf from this repo, set nginx.replace_template to True. The default is False

      nginx:
          replace_template: False
  • LEMP
  • postfix

    postfix:
        main_mailer_type: Internet Site
        mailname: "{{ ansible_hostname }}"
        protocol: ipv4
  • XDebug

Trouble shooting

If tasks are timing out due to a slow connection, add:

  async: 1800

You will have to break apart tasks with_items to indvidual ones.

Since this uses node via nvm, you have to source ~/.zshrc (to load nvm) before any node or npm related task.

Release notes

  • 2.8.0 - mcrypt pulled out into its own file
  • 2.7.0 - loops moved to array & other formatting
  • 2.6.0 - can override skipping mongo reinstall
  • 2.5.0 - php soap added
  • 2.4.0 - php zip added
  • 2.3.0 - php-fpm 7.2 support
  • 2.2.0 - XDebug for php-fpm 7.1
  • 2.1.4 - Updating Java install to work - Oracle JDK via webupd8team is now broken
  • 2.1.3 - Adding mongo driver to phpt
  • 2.1.2 - Patch for checking on /var/run in php
  • 2.1.1 - Do not install mongo as part of php, and some Elasticsearch tweaks
  • 2.1.0 - Certbot
  • 2.0.2 - Testing this and future versions on Ubuntu 16
  • 1.7.0 - Testing 1.x versions on Ubuntu 14
2.8.4

4 years ago

2.8.3

4 years ago

2.8.1

5 years ago

2.8.0

6 years ago

2.7.0

6 years ago

2.6.0

6 years ago

2.5.1

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.2

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.1.11

7 years ago

2.1.10

7 years ago

2.1.9

7 years ago

2.1.8

7 years ago

2.1.7

7 years ago

2.1.6

7 years ago

2.1.5

7 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.8.2

7 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.0

8 years ago

1.6.2

8 years ago

1.6.1

8 years ago

1.6.0

8 years ago

1.5.2

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.4

8 years ago

1.4.3

8 years ago

1.4.2

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

1.0.0-build.2

9 years ago

1.0.0-build.1

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.3

9 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago