This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
ansible-examples should adhere to the standards of the ansible-linter #323
Open
RayJin2000
wants to merge
11
commits into
ansible:master
Choose a base branch
from
RayJin2000:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c5e3890
linter
RayJin2000 6a5ca9e
wordpress linter
RayJin2000 60cd937
linted tomcat-standalone & windows
RayJin2000 bd3411d
linted tomcat-memcached-failover
RayJin2000 382710a
linted rust
RayJin2000 314d31a
linted phillips hue
RayJin2000 b600d6d
linted mongodb
RayJin2000 65f6d05
linted language_features
RayJin2000 48573ac
linter
RayJin2000 b5f2d6f
linter
RayJin2000 ff480cc
linter
RayJin2000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
--- | ||
- name: restart jboss | ||
service: | ||
- name: Restart jboss | ||
ansible.builtin.service: | ||
name: jboss | ||
state: restarted | ||
listen: restart_jboss | ||
|
||
- name: restart iptables | ||
service: | ||
- name: Restart iptables | ||
ansible.builtin.service: | ||
name: iptables | ||
state: restarted | ||
listen: restart_iptables | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why use snake_case for handlers? They aren't Python identifiers. It'd be confusing. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,102 @@ | ||
--- | ||
- name: Install Java 1.7 and some basic dependencies | ||
yum: | ||
ansible.builtin.yum: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: | ||
- unzip | ||
- java-1.7.0-openjdk | ||
- libselinux-python | ||
- libsemanage-python | ||
- unzip | ||
- java-1.7.0-openjdk | ||
- libselinux-python | ||
- libsemanage-python | ||
|
||
- name: Download JBoss from jboss.org | ||
get_url: | ||
ansible.builtin.get_url: | ||
url: http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip | ||
dest: /opt/jboss-as-7.1.1.Final.zip | ||
|
||
- name: Extract archive | ||
unarchive: | ||
ansible.builtin.unarchive: | ||
dest: /usr/share | ||
src: /opt/jboss-as-7.1.1.Final.zip | ||
creates: /usr/share/jboss-as | ||
copy: no | ||
copy: false | ||
|
||
# Rename the dir to avoid encoding the version in the init script | ||
# Rename the dir to avoid encoding the version in the init script | ||
- name: Rename install directory | ||
command: /bin/mv jboss-as-7.1.1.Final jboss-as | ||
ansible.builtin.command: /bin/mv jboss-as-7.1.1.Final jboss-as | ||
args: | ||
chdir: /usr/share | ||
chdir: /usr/share | ||
creates: /usr/share/jboss-as | ||
|
||
- name: Copying standalone.xml configuration file | ||
template: | ||
ansible.builtin.template: | ||
src: standalone.xml | ||
dest: /usr/share/jboss-as/standalone/configuration/ | ||
notify: restart jboss | ||
notify: restart_jboss | ||
|
||
- name: Add group "jboss" | ||
group: | ||
ansible.builtin.group: | ||
name: jboss | ||
|
||
- name: Add user "jboss" | ||
user: | ||
ansible.builtin.user: | ||
name: jboss | ||
group: jboss | ||
home: /usr/share/jboss-as | ||
|
||
- name: Change ownership of JBoss installation | ||
file: | ||
ansible.builtin.file: | ||
path: /usr/share/jboss-as/ | ||
owner: jboss | ||
group: jboss | ||
state: directory | ||
recurse: yes | ||
recurse: true | ||
|
||
- name: Copy the init script | ||
copy: | ||
ansible.builtin.copy: | ||
src: jboss-as-standalone.sh | ||
dest: /etc/init.d/jboss | ||
mode: 0755 | ||
mode: "0755" | ||
|
||
- name: Workaround for systemd bug | ||
shell: service jboss start && chkconfig jboss on | ||
ignore_errors: yes | ||
ansible.builtin.shell: service jboss start && chkconfig jboss on | ||
ignore_errors: true | ||
|
||
- name: Enable JBoss to be started at boot | ||
service: | ||
ansible.builtin.service: | ||
name: jboss | ||
enabled: yes | ||
enabled: true | ||
state: started | ||
|
||
- name: deploy iptables rules | ||
template: | ||
- name: Deploy iptables rules | ||
ansible.builtin.template: | ||
src: iptables-save | ||
dest: /etc/sysconfig/iptables | ||
owner: root | ||
group: root | ||
mode: u=rw,g=,o= | ||
when: ansible_distribution_major_version != "7" | ||
notify: restart iptables | ||
notify: restart_iptables | ||
|
||
- name: Ensure that firewalld is installed | ||
yum: | ||
ansible.builtin.yum: | ||
name: firewalld | ||
state: present | ||
when: ansible_distribution_major_version == "7" | ||
|
||
- name: Ensure that firewalld is started | ||
service: | ||
ansible.builtin.service: | ||
name: firewalld | ||
state: started | ||
when: ansible_distribution_major_version == "7" | ||
|
||
- name: deploy firewalld rules | ||
firewalld: | ||
immediate: yes | ||
- name: Deploy firewalld rules | ||
ansible.posix.firewalld: | ||
immediate: true | ||
port: "{{ item }}" | ||
state: enabled | ||
permanent: yes | ||
permanent: true | ||
when: ansible_distribution_major_version == "7" | ||
with_items: | ||
- "{{ http_port }}/tcp" | ||
- "{{ https_port }}/tcp" | ||
|
||
- "{{ http_port }}/tcp" | ||
- "{{ https_port }}/tcp" |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also a YAML sequence, for example. And it's not indented like the rest of things, which is inconsistent. Ideally, there shouldn't be unnecessary indentation without a good reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont get your point here. This yaml file is indented like all other yaml files.