Commit f4ea87f4 authored by Ing. Matej Madeja's avatar Ing. Matej Madeja
Browse files

prepared first version of awx install

parent bf86dbf1
---
tasks file for mariadb-config
# tasks file for mariadb-config
- name: Install phpmyadmin and dependencies
apt:
pkg:
......@@ -10,6 +10,7 @@ tasks file for mariadb-config
update_cache: yes
become: yes
notify: restart apache
# debugger: always # enter debugger
- name: "Ensure phpmyadmin config is include in main apache config"
become: yes
......
[defaults]
inventory = ./hosts
vault_password_file = .vault_pass
deprecation_warnings=False
\ No newline at end of file
ansible_user: vagrant
ansible_host: 127.0.0.1
ansible_become_pass: '{{ sudo_password }}'
\ No newline at end of file
ansible_port: 12022
\ No newline at end of file
[linuxes]
debian
ubuntu
centos
[locals]
# localhost ansible_user=matt ansible_connection=local
\ No newline at end of file
---
- name: "Install LAMP stack"
hosts:
- linuxes
become: yes
roles:
- awx
$ANSIBLE_VAULT;1.1;AES256
34376533336163653161363066396661663662623664623836646564616662336530653563666339
6537616434363161306132666535626464343431326533360a376130633166323137623265666234
33363431323936373032393266373037373834386464356265656332336238333030663937376231
3335646631313065330a643862363533383738663464623265663431353631666665623362626537
35653038353634366139373539386232623033616538343130653065663433643065
```
ansible-playbook lamp.yml --extra-vars="@passwds.yml"
```
\ No newline at end of file
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
\ No newline at end of file
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
---
# defaults file for awx
\ No newline at end of file
---
# handlers file for awx
\ No newline at end of file
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
\ No newline at end of file
---
# tasks file for awx
- name: Download repo
git:
repo: https://github.com/ansible/awx.git
dest: /tmp/awx
force: yes
- name: Change default pass
lineinfile:
path: /tmp/awx/installer/inventory
regexp: "^admin_password=password$"
line: "admin_password={{ sudo_password }}"
- name: Check if port 80 is free
wait_for:
port: 80
timeout: 10
msg: "Waiting for response"
register: port_result
ignore_errors: yes
- debug:
var: port_result
- name: Change default port
lineinfile:
path: /tmp/awx/installer/inventory
regexp: "^host_port=80$"
line: "host_port=8080"
when: port_result.state == "started"
- name: Install prerequisities
apt:
pkg:
- python
- python-pip
- python3
- python3-pip
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
update_cache: yes
- name: Add repo
shell: "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -; apt-key fingerprint 0EBFCD88; add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\""
- name: Install docker
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
update_cache: yes
- name: Install ansible, docker for python and docker-compose
pip:
name:
- ansible
- docker
- docker-compose
- name: Install SWX
shell: "ansible-playbook /tmp/awx/installer/install.yml -i /tmp/awx/installer/inventory"
---
- hosts: localhost
remote_user: root
roles:
- awx
\ No newline at end of file
---
# vars file for awx
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment