You've already forked ansible-directadmin
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b563a9478a | ||
|
|
2e0fef1654 |
@@ -12,8 +12,8 @@ addons:
|
|||||||
- python-pip
|
- python-pip
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# Install requirements
|
# Install ansible
|
||||||
- pip install -r requirements.txt -U
|
- pip install ansible
|
||||||
|
|
||||||
# Check ansible version
|
# Check ansible version
|
||||||
- ansible --version
|
- ansible --version
|
||||||
@@ -26,5 +26,4 @@ script:
|
|||||||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
webhooks:
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||||
- https://galaxy.ansible.com/api/v1/notifications/
|
|
||||||
@@ -10,11 +10,8 @@ directadmin_setup_path: /root
|
|||||||
directadmin_ethernet_device: eth0
|
directadmin_ethernet_device: eth0
|
||||||
directadmin_custombuild_options_conf: # like http://yourdomain.com/options.conf
|
directadmin_custombuild_options_conf: # like http://yourdomain.com/options.conf
|
||||||
directadmin_custombuild_version: 2.0
|
directadmin_custombuild_version: 2.0
|
||||||
directadmin_path: /usr/local/directadmin/
|
directadmin_custombuild_path: /usr/local/directadmin/custombuild
|
||||||
directadmin_config_path: "{{ directadmin_path }}conf/directadmin.conf"
|
|
||||||
directadmin_custombuild_path: "{{ directadmin_path }}custombuild"
|
|
||||||
directadmin_cache_timeout: 3600
|
directadmin_cache_timeout: 3600
|
||||||
directadmin_letsencrypt: True
|
|
||||||
|
|
||||||
# Packages - http://help.directadmin.com/item.php?id=354
|
# Packages - http://help.directadmin.com/item.php?id=354
|
||||||
directadmin_debian6_packages:
|
directadmin_debian6_packages:
|
||||||
@@ -109,49 +106,6 @@ directadmin_debian8_packages:
|
|||||||
- patch
|
- patch
|
||||||
- libjemalloc-dev
|
- libjemalloc-dev
|
||||||
|
|
||||||
directadmin_debian9_packages:
|
|
||||||
- autoconf
|
|
||||||
- automake
|
|
||||||
- bind9
|
|
||||||
- bison
|
|
||||||
- bsd-mailx
|
|
||||||
- bzip2
|
|
||||||
- cmake
|
|
||||||
- cron
|
|
||||||
- dnsutils
|
|
||||||
- flex
|
|
||||||
- g++
|
|
||||||
- gcc
|
|
||||||
- libaio-dev
|
|
||||||
- libaio1
|
|
||||||
- libc6-dev
|
|
||||||
- libcap-dev
|
|
||||||
- libcrypt-openssl-rsa-perl
|
|
||||||
- libdb-dev
|
|
||||||
- libexpat1-dev
|
|
||||||
- libjemalloc-dev
|
|
||||||
- libncurses5-dev
|
|
||||||
- libnuma-dev
|
|
||||||
- libnuma1
|
|
||||||
- libperl-dev
|
|
||||||
- libsasl2-dev
|
|
||||||
- libssl-dev
|
|
||||||
- libsystemd-dev
|
|
||||||
- libtool
|
|
||||||
- logrotate
|
|
||||||
- make
|
|
||||||
- openssl
|
|
||||||
- patch
|
|
||||||
- perl
|
|
||||||
- perl-base
|
|
||||||
- perl-modules
|
|
||||||
- pkg-config
|
|
||||||
- python
|
|
||||||
- quota
|
|
||||||
- rsyslog
|
|
||||||
- zlib1g
|
|
||||||
- zlib1g-dev
|
|
||||||
|
|
||||||
directadmin_rhel_generic_packages:
|
directadmin_rhel_generic_packages:
|
||||||
- gcc
|
- gcc
|
||||||
- gcc-c++
|
- gcc-c++
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- name: restart directadmin
|
|
||||||
service:
|
|
||||||
name: directadmin
|
|
||||||
state: restarted
|
|
||||||
@@ -4,7 +4,7 @@ galaxy_info:
|
|||||||
description: Deploy DirectAdmin with Ansible
|
description: Deploy DirectAdmin with Ansible
|
||||||
company: Hyperized Hosting
|
company: Hyperized Hosting
|
||||||
license: MIT
|
license: MIT
|
||||||
min_ansible_version: 2.5
|
min_ansible_version: 2.1
|
||||||
platforms:
|
platforms:
|
||||||
- name: EL
|
- name: EL
|
||||||
versions:
|
versions:
|
||||||
@@ -17,7 +17,6 @@ galaxy_info:
|
|||||||
- jessie
|
- jessie
|
||||||
- squeeze
|
- squeeze
|
||||||
- wheezy
|
- wheezy
|
||||||
- stretch
|
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- system
|
- system
|
||||||
- web
|
- web
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
ansible
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
- name: execute LetsEncrypt setup script
|
|
||||||
command: letsencrypt.sh request_single {{ directadmin_hostname }} 4096
|
|
||||||
args:
|
|
||||||
chdir: /usr/local/directadmin/scripts/
|
|
||||||
register: directadmin_letsencrypt_output
|
|
||||||
|
|
||||||
- debug:
|
|
||||||
var: directadmin_letsencrypt_output.stdout_lines
|
|
||||||
|
|
||||||
- name: enable SSL with LetsEncrypt for DirectAdmin
|
|
||||||
lineinfile:
|
|
||||||
path: directadmin_config_path
|
|
||||||
regexp: item.regexp
|
|
||||||
line: item.line
|
|
||||||
with_items:
|
|
||||||
- { regexp: '^SSL\=0' , line: 'SSL=1' }
|
|
||||||
- { regexp: '^carootcert=' , line: 'carootcert=/usr/local/directadmin/conf/carootcert.pem' }
|
|
||||||
- { regexp: '^force_hostname=' , line: "force_hostname={{ directadmin_hostname }}" }
|
|
||||||
- { regexp: '^ssl_redirect_host=' , line: "ssl_redirect_host={{ directadmin_hostname }}" }
|
|
||||||
- { regexp: '^letsencrypt=' , line: "letsencrypt=1" }
|
|
||||||
notify:
|
|
||||||
- restart directadmin
|
|
||||||
@@ -7,9 +7,7 @@
|
|||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ directadmin_debian6_packages }}"
|
- "{{ directadmin_debian6_packages }}"
|
||||||
when:
|
when: "ansible_distribution == 'Debian' and ansible_distribution_release == 'squeeze'"
|
||||||
- ansible_distribution == 'Debian'
|
|
||||||
- ansible_distribution_release == 'squeeze'
|
|
||||||
|
|
||||||
- name: Install dependencies for Debian 7 Wheezy
|
- name: Install dependencies for Debian 7 Wheezy
|
||||||
apt:
|
apt:
|
||||||
@@ -19,23 +17,9 @@
|
|||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ directadmin_debian7_packages }}"
|
- "{{ directadmin_debian7_packages }}"
|
||||||
when:
|
when: "ansible_distribution == 'Debian' and ansible_distribution_release == 'wheezy'"
|
||||||
- ansible_distribution == 'Debian'
|
|
||||||
- ansible_distribution_release == 'wheezy'
|
|
||||||
|
|
||||||
- name: Install dependencies for Debian 8 Jessie
|
- name: Install dependencies for Debian 8 Jessie
|
||||||
apt:
|
|
||||||
name: "{{ item }}"
|
|
||||||
update_cache: yes
|
|
||||||
cache_valid_time: "{{ directadmin_cache_timeout }}"
|
|
||||||
state: present
|
|
||||||
with_items:
|
|
||||||
- "{{ directadmin_debian9_packages }}"
|
|
||||||
when:
|
|
||||||
- ansible_distribution == 'Debian'
|
|
||||||
- ansible_distribution_release == 'jessie'
|
|
||||||
|
|
||||||
- name: Install dependencies for Debian 9 Stretch
|
|
||||||
apt:
|
apt:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
@@ -43,6 +27,4 @@
|
|||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ directadmin_debian8_packages }}"
|
- "{{ directadmin_debian8_packages }}"
|
||||||
when:
|
when: "ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'"
|
||||||
- ansible_distribution == 'Debian'
|
|
||||||
- ansible_distribution_release == 'jessie'
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
update_cache: yes
|
update_cache: yes
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ directadmin_rhel_generic_packages }}"
|
- "{{ directadmin_rhel_packages_generic }}"
|
||||||
|
|
||||||
- name: install everywhere but on CentOS7
|
- name: install everywhere but on CentOS7
|
||||||
yum:
|
yum:
|
||||||
@@ -14,9 +14,7 @@
|
|||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ directadmin_rhel_packages }}"
|
- "{{ directadmin_rhel_packages }}"
|
||||||
when:
|
when: ansible_distribution not 'CentOS' and ansible_distribution_version|version_compare('ne', 7)
|
||||||
- ansible_distribution not 'CentOS'
|
|
||||||
- ansible_distribution_version is version(7, 'ne')
|
|
||||||
|
|
||||||
- name: install CentOS 7 specific requirements
|
- name: install CentOS 7 specific requirements
|
||||||
yum:
|
yum:
|
||||||
@@ -25,6 +23,4 @@
|
|||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ directadmin_centos7_packages }}"
|
- "{{ directadmin_centos7_packages }}"
|
||||||
when:
|
when: ansible_distribution == 'CentOS' and ansible_distribution_version|version_compare('=', 7)
|
||||||
- ansible_distribution is 'CentOS'
|
|
||||||
- ansible_distribution_version is version(7, '=')
|
|
||||||
|
|||||||
@@ -14,15 +14,16 @@
|
|||||||
src: .custombuild.j2
|
src: .custombuild.j2
|
||||||
dest: "{{ directadmin_setup_path }}/.custombuild"
|
dest: "{{ directadmin_setup_path }}/.custombuild"
|
||||||
|
|
||||||
- name: check if DA is already present on host
|
- name: check if DA is already running on host
|
||||||
stat:
|
uri:
|
||||||
path: "{{ directadmin_config_path }}"
|
url: http://localhost:2222
|
||||||
register: directadmin_present
|
return_content: no
|
||||||
|
register: da_present
|
||||||
|
|
||||||
- name: toggle whether to install DA or not
|
- name: toggle whether to install DA or not
|
||||||
set_fact:
|
set_fact:
|
||||||
directadmin_install: False
|
directadmin_install: False
|
||||||
when: directadmin_present.stat.exists == True
|
when: da_present.status == 200
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: ensure directadmin path if remote options file is used
|
- name: ensure directadmin path if remote options file is used
|
||||||
@@ -53,10 +54,6 @@
|
|||||||
var: setup_output.stdout_lines
|
var: setup_output.stdout_lines
|
||||||
when: directadmin_install
|
when: directadmin_install
|
||||||
|
|
||||||
- name: ensure Letsencrypt
|
|
||||||
include: letsencrypt.yml
|
|
||||||
when: directadmin_letsencrypt
|
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "Directadmin is already installed and running, skipping.."
|
msg: "Directadmin is already installed and running, skipping.."
|
||||||
when: not directadmin_install
|
when: not directadmin_install
|
||||||
|
|||||||
Reference in New Issue
Block a user