Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linting fixes pr 1.x #805

Merged
merged 3 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions roles/_init/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

- name: Build the list of directories to scan for changes.
ansible.builtin.set_fact:
_init_vars_dirs_list: "{{ _init.vars_dirs + [ playbook_dir ] }}"
_init_vars_dirs_list: "{{ _init.vars_dirs + [playbook_dir] }}"

- name: Compute files md5 hash.
ansible.builtin.shell: 'find {{ _init_vars_dir }} -type f -exec md5sum {} \; | cut -d " " -f1 | md5sum'
Expand All @@ -45,7 +45,7 @@

- name: Lookup current playbook md5
ansible.builtin.set_fact:
previous_play_dir_md5: "{{ lookup('file', '{{ _ce_provision_data_dir }}/{{ current_play_md5_file }}' ) }}"
previous_play_dir_md5: "{{ lookup('file', '{{ _ce_provision_data_dir }}/{{ current_play_md5_file }}') }}"

- name: Stop play if playbook md5 is unchanged.
ansible.builtin.meta: end_play
Expand Down
2 changes: 1 addition & 1 deletion roles/apache/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ apache:
log_stream_name: example
# We can only have one backend, due to the way we use "common" templates.
# Moving this per domain means instead having templates per project type.
php_fastcgi_backend: "127.0.0.1:90{{ php.version[-1] | replace('.','') }}"
php_fastcgi_backend: "127.0.0.1:90{{ php.version[-1] | replace('.', '') }}"
limit_request_body: "734003200" #700M
timeout: 120
max_clients: 256
Expand Down
10 changes: 5 additions & 5 deletions roles/aws/aws_acm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

- name: Build list of tags as Key,Value strings.
ansible.builtin.set_fact:
_aws_tags_list: "{{ _aws_tags_list + [ 'Key=' + item.key + ',' + 'Value=' + item.value ] }}"
_aws_tags_list: "{{ _aws_tags_list + ['Key=' + item.key + ',' + 'Value=' + item.value] }}"
loop: "{{ aws_acm.tags | dict2items }}"
when: aws_acm.tags | length > 0

Expand Down Expand Up @@ -63,7 +63,7 @@

- name: Build a list of additional domains.
ansible.builtin.set_fact:
_acm_san_domains: "{{ _acm_san_domains + [ item.domain ] }}"
_acm_san_domains: "{{ _acm_san_domains + [item.domain] }}"
loop: "{{ aws_acm.extra_domains }}"
when: aws_acm.extra_domains | length > 0

Expand Down Expand Up @@ -131,7 +131,7 @@

- name: Add extra_domains so we can loop through DNS records.
ansible.builtin.set_fact:
_acm_dns_all_domains: "{{ _acm_dns_all_domains + [ { 'domain': item.domain, 'zone': item.zone, 'aws_profile': item.aws_profile } ] }}"
_acm_dns_all_domains: "{{ _acm_dns_all_domains + [{ 'domain': item.domain, 'zone': item.zone, 'aws_profile': item.aws_profile }] }}"
loop: "{{ aws_acm.extra_domains }}"
when:
- aws_acm.extra_domains | length > 0
Expand All @@ -143,9 +143,9 @@
state: present
profile: "{{ item.aws_profile }}"
zone: "{{ item.zone }}"
record: "{{ ( _aws_acm_new_certificate.certificates[0].domain_validation_options | selectattr('domain_name', 'search', item.domain) )[0].resource_record.name }}"
record: "{{ (_aws_acm_new_certificate.certificates[0].domain_validation_options | selectattr('domain_name', 'search', item.domain))[0].resource_record.name }}"
type: CNAME
value: "{{ ( _aws_acm_new_certificate.certificates[0].domain_validation_options | selectattr('domain_name', 'search', item.domain) )[0].resource_record.value }}"
value: "{{ (_aws_acm_new_certificate.certificates[0].domain_validation_options | selectattr('domain_name', 'search', item.domain))[0].resource_record.value }}"
overwrite: true
loop: "{{ _acm_dns_all_domains }}"
when:
Expand Down
2 changes: 1 addition & 1 deletion roles/aws/aws_ami/tasks/repack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
- name: Merge repack extra variables with provided extra variables.
ansible.builtin.set_fact:
aws_ami:
extra_vars: "{{ aws_ami.extra_vars + [ item ] }}"
extra_vars: "{{ aws_ami.extra_vars + [item] }}"
with_items: "{{ _aws_ami_repack_extra_vars }}"
when: aws_ami_running_instances.instances | length > 0

Expand Down
6 changes: 3 additions & 3 deletions roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
filters:
"tag:Name": "{{ aws_ec2_autoscale_cluster.vpc_name }}"
register: _aws_ec2_autoscale_cluster_vpc
when: ( aws_ec2_autoscale_cluster.vpc_name is defined and aws_ec2_autoscale_cluster.vpc_name | length > 0 )
when: (aws_ec2_autoscale_cluster.vpc_name is defined and aws_ec2_autoscale_cluster.vpc_name | length > 0)

- name: Set the VPC id from name.
ansible.builtin.set_fact:
_aws_ec2_autoscale_cluster_vpc_id: "{{ _aws_ec2_autoscale_cluster_vpc.vpcs[0].vpc_id }}"
when: ( aws_ec2_autoscale_cluster.vpc_name is defined and aws_ec2_autoscale_cluster.vpc_name | length > 0 )
when: (aws_ec2_autoscale_cluster.vpc_name is defined and aws_ec2_autoscale_cluster.vpc_name | length > 0)

- name: Use provided VPC id.
ansible.builtin.set_fact:
_aws_ec2_autoscale_cluster_vpc_id: "{{ aws_ec2_autoscale_cluster.vpc_id }}"
when: ( aws_ec2_autoscale_cluster.vpc_name is not defined or aws_ec2_autoscale_cluster.vpc_name | length < 0 )
when: (aws_ec2_autoscale_cluster.vpc_name is not defined or aws_ec2_autoscale_cluster.vpc_name | length < 0)

- name: Create matching Security Group.
amazon.aws.ec2_group:
Expand Down
2 changes: 1 addition & 1 deletion roles/hosts/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: restart hosts
- name: Restart hosts.
service:
name: ncsd
state: restarted
2 changes: 1 addition & 1 deletion roles/jenkins/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: restart jenkins
- name: Restart Jenkins.
service:
name: jenkins
state: restarted
10 changes: 5 additions & 5 deletions roles/jenkins/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
group: "{{ jenkins.user }}"
mode: 0775

- name: restart jenkins
- name: Restart Jenkins.
ansible.builtin.service:
name: jenkins
state: restarted
Expand All @@ -96,25 +96,25 @@
minutes: 2
when: aptoutput.changed

- name: Download Jenkins CLI
- name: Download Jenkins CLI.
ansible.builtin.get_url:
url: "https://localhost:{{ jenkins.listen_https_port }}/jnlpJars/jenkins-cli.jar"
validate_certs: false
dest: /opt/jenkins-cli.jar

- name: Add Jenkins cert renewal job
- name: Add Jenkins cert renewal job.
ansible.builtin.template:
src: "jenkins-cert-renewal.sh.j2"
dest: /etc/cron.daily/jenkins-cert-renewal
mode: 0755

- name: Install Jenkins Plugins
- name: Install Jenkins Plugins.
ansible.builtin.command: "java -jar /opt/jenkins-cli.jar -auth {{ jenkins.adminuser }}:{{ jenkins.adminpass }} -noCertificateCheck -s https://localhost:{{ jenkins.listen_https_port }}/ install-plugin {{ jenkins.plugins | join(' ') }}"
become: true
become_user: "{{ jenkins.user }}"
register: pluginoutput

- name: Safe restart jenkins
- name: Safe restart Jenkins.
ansible.builtin.command: "java -jar /opt/jenkins-cli.jar -auth {{ jenkins.adminuser }}:{{ jenkins.adminpass }} -noCertificateCheck -s https://localhost:{{ jenkins.listen_https_port }}/ safe-restart"
become: true
become_user: "{{ jenkins.user }}"
Expand Down
8 changes: 4 additions & 4 deletions roles/ossec/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
# handlers file for ossec

- name: restart ossec
- name: Restart OSSEC.
service:
name: "ossec"
state: restarted

- name: stop ossec-authd
- name: Stop ossec-authd.
ignore_errors: true
command: "pkill ossec-authd"

- name: start ossec-authd
command: "/var/ossec/bin/ossec-authd -k {{ ssl_facts[ossec.ssl.domain].key }} -x {{ ssl_facts[ossec.ssl.domain].certificate }}"
- name: Start ossec-authd.
command: "/var/ossec/bin/ossec-authd -k {{ ssl_facts[ossec.ssl.domain].key }} -x {{ ssl_facts[ossec.ssl.domain].certificate }}"
2 changes: 1 addition & 1 deletion roles/ossec/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
owner: root
group: ossec
mode: "0440"
notify: restart ossec
notify: Restart OSSEC.
8 changes: 4 additions & 4 deletions roles/ossec/tasks/ossec-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
group: ossec
mode: "0550"
with_fileglob: "*_rules.xml"
notify: restart ossec
notify: Restart OSSEC.

- name: Copy OSSEC authentication password.
ansible.builtin.template:
Expand All @@ -41,8 +41,8 @@
group: ossec
mode: "0440"
notify:
- stop ossec-authd
- start ossec-authd
- Stop ossec-authd.
- Start ossec-authd.

- name: Generates SSL keys.
ansible.builtin.include_role:
Expand All @@ -51,4 +51,4 @@
ssl: "{{ ossec.ssl }}"

- name: Start ossec-authd.
ansible.builtin.command: "/var/ossec/bin/ossec-authd -k {{ ssl_facts[ossec.ssl.domain].key }} -x {{ ssl_facts[ossec.ssl.domain].certificate }}"
ansible.builtin.command: "/var/ossec/bin/ossec-authd -k {{ ssl_facts[ossec.ssl.domain].key }} -x {{ ssl_facts[ossec.ssl.domain].certificate }}"
8 changes: 4 additions & 4 deletions roles/postfix/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- name: initialize transport
- name: Initialise transport.
command: /usr/sbin/postmap /etc/postfix/transport

- name: initialize sasl_passwd
- name: Initialise sasl_passwd.
command: /usr/sbin/postmap /etc/postfix/sasl_passwd

- name: initialize virtual
- name: Initialise virtual.
command: /usr/sbin/postmap /etc/postfix/virtual

- name: reload postfix configuration
- name: Reload Postfix configuration.
command: /usr/sbin/postfix reload
14 changes: 7 additions & 7 deletions roles/postfix/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
owner: root
group: root
mode: "0644"
notify: reload postfix configuration
notify: Reload Postfix configuration.

- name: Configure transport
ansible.builtin.template:
Expand All @@ -39,8 +39,8 @@
group: root
mode: "0644"
notify:
- initialize transport
- reload postfix configuration
- Initialise transport.
- Reload Postfix configuration.

- name: Install SASL
ansible.builtin.package:
Expand All @@ -57,8 +57,8 @@
mode: "0644"
when: postfix.use_ses
notify:
- initialize sasl_passwd
- reload postfix configuration
- Initialise sasl_passwd.
- Reload Postfix configuration.

- name: Configure virtual
ansible.builtin.template:
Expand All @@ -69,8 +69,8 @@
mode: "0644"
when: postfix.forward
notify:
- initialize virtual
- reload postfix configuration
- Initialise virtual.
- Reload Postfix configuration.

- name: Ensure host maildir exists.
ansible.builtin.file:
Expand Down