Created
December 28, 2018 21:08
-
-
Save joseb0rges/7a46fe8219847d6d6b4fd2d8faaebd70 to your computer and use it in GitHub Desktop.
PlayBook_Wildfly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: tux | |
tasks: | |
- name: Install Java 1.8 | |
yum: name={{item}} state=present | |
with_items: | |
- java-1.8.0-openjdk | |
- name: "Instala o wget e unzip" | |
shell: yum -y install wget unzip | |
- name: "Instala o OpenSSL" | |
yum: name=openssl state=latest | |
- name: "Download do WildFly" | |
get_url: url=http://download.jboss.org/wildfly/8.2.1.Final/wildfly-8.2.1.Final.zip dest=/tmp/wildfly-8.2.1.Final.zip | |
- name: "Descompacta o WildFly em /opt" | |
unarchive: src=/tmp/wildfly-8.2.1.Final.zip dest=/opt copy=no | |
- name: "Cria link simbolico para o WildFly" | |
shell: ln -s /opt/wildfly-* /opt/wildfly | |
- name: "Copia o arquivo wildfly.service para criar o serviço" | |
copy: src=wildfly.service dest=/etc/systemd/system | |
- name: "Permissão do serviço" | |
shell: chmod 644 /etc/systemd/system/wildfly.service | |
- name: "Usuario WildFly" | |
shell: useradd -p `openssl passwd -1 wildfly` wildfly | |
- name: "Adiciona ao Grupo wildfly" | |
shell: usermod -aG wildfly wildfly | |
- name: "Permissão do diretório" | |
shell: chown -R wildfly:wildfly /opt/wildfly* | |
- name: "Configura o usuario do wildfly como sudo" | |
lineinfile: 'dest=/etc/sudoers line="wildfly ALL=(ALL) NOPASSWD:ALL" state=present validate="visudo -cf %s"' | |
- name: "Habilita o servico do WildFly" | |
shell: systemctl enable wildfly.service | |
- name: "Inicia o servico do WildFly" | |
shell: systemctl start wildfly.service | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment