mirror: ansible-lint fixes
This commit is contained in:
parent
a849d1f2a9
commit
c5898365ce
4 changed files with 54 additions and 55 deletions
|
@ -1,16 +1,16 @@
|
||||||
---
|
---
|
||||||
- name: install rsync
|
- name: Install rsync
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: rsync
|
name: rsync
|
||||||
state: installed
|
state: installed
|
||||||
|
|
||||||
- name: create mirror group
|
- name: Create mirror group
|
||||||
group:
|
ansible.builtin.group:
|
||||||
name: mirror
|
name: mirror
|
||||||
gid: 1001
|
gid: 1001
|
||||||
|
|
||||||
- name: create mirror user
|
- name: Create mirror user
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: mirror
|
name: mirror
|
||||||
comment: Service Mirror
|
comment: Service Mirror
|
||||||
createhome: false
|
createhome: false
|
||||||
|
@ -19,37 +19,37 @@
|
||||||
shell: /sbin/nologin
|
shell: /sbin/nologin
|
||||||
uid: 1001
|
uid: 1001
|
||||||
|
|
||||||
- name: create data directory
|
- name: Create data directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /export/mirrors
|
path: /export/mirrors
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: fix selinux contexts from data directory
|
- name: Fix selinux contexts from data directory
|
||||||
sefcontext:
|
community.general.sefcontext:
|
||||||
path: /export/mirrors(/.*)?
|
path: /export/mirrors(/.*)?
|
||||||
setype: public_content_t
|
setype: public_content_t
|
||||||
|
|
||||||
- name: create data directory link
|
- name: Create data directory link
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /srv/mirrors
|
path: /srv/mirrors
|
||||||
state: link
|
state: link
|
||||||
src: /export/mirrors
|
src: /export/mirrors
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: create config directory
|
- name: Create config directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /etc/sync-mirrors
|
path: /etc/sync-mirrors
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: create runtime and log directories
|
- name: Create runtime and log directories
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
@ -59,32 +59,32 @@
|
||||||
- /var/run/sync-mirrors
|
- /var/run/sync-mirrors
|
||||||
- /var/log/sync-mirrors
|
- /var/log/sync-mirrors
|
||||||
|
|
||||||
- name: configure tmpfiles to create runtime directory on boot
|
- name: Configure tmpfiles to create runtime directory on boot
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
dest: /usr/lib/tmpfiles.d/sync-mirrors.conf
|
dest: /usr/lib/tmpfiles.d/sync-mirrors.conf
|
||||||
content: "d /run/sync-mirrors 0755 mirror mirror\n"
|
content: "d /run/sync-mirrors 0755 mirror mirror\n"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: copy mirroring script
|
- name: Copy mirroring script
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
dest: /usr/local/bin/sync-mirrors
|
dest: /usr/local/bin/sync-mirrors
|
||||||
src: sync-mirrors
|
src: sync-mirrors
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: create mirror cron job
|
- name: Create mirror cron job
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: sync-mirrors
|
name: sync-mirrors
|
||||||
hour: "0,6,12,18"
|
hour: "0,6,12,18"
|
||||||
minute: "0"
|
minute: "0"
|
||||||
job: /usr/local/bin/sync-mirrors
|
job: /usr/local/bin/sync-mirrors
|
||||||
user: mirror
|
user: mirror
|
||||||
|
|
||||||
- name: create log rotate cron job for sync-mirrors
|
- name: Create log rotate cron job for sync-mirrors
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: sync-mirrors-logs
|
name: sync-mirrors-logs
|
||||||
hour: "5"
|
hour: "5"
|
||||||
minute: "10"
|
minute: "10"
|
||||||
|
@ -92,15 +92,15 @@
|
||||||
-mtime +30 -name '*.log' -execdir rm {} \\+"
|
-mtime +30 -name '*.log' -execdir rm {} \\+"
|
||||||
user: mirror
|
user: mirror
|
||||||
|
|
||||||
- name: copy static web content
|
- name: Copy static web content
|
||||||
synchronize:
|
ansible.posix.synchronize:
|
||||||
dest: "/srv/web/{{ inventory_hostname }}/"
|
dest: "/srv/web/{{ inventory_hostname }}/"
|
||||||
delete: true
|
delete: true
|
||||||
recursive: true
|
recursive: true
|
||||||
src: static
|
src: static
|
||||||
|
|
||||||
- name: create apache mirror config
|
- name: Create apache mirror config
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: mirror.conf.j2
|
src: mirror.conf.j2
|
||||||
dest: /etc/httpd/conf.local.d/mirror.conf
|
dest: /etc/httpd/conf.local.d/mirror.conf
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
---
|
---
|
||||||
- name: install python3
|
- name: Install python3
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: python3
|
name: python3
|
||||||
state: installed
|
state: installed
|
||||||
|
|
||||||
- name: copy repportmirror files
|
- name: Copy repportmirror files
|
||||||
git:
|
ansible.builtin.git:
|
||||||
dest: /usr/local/src/report_mirror
|
dest: /usr/local/src/report_mirror
|
||||||
repo: https://github.com/fedora-infra/mirrormanager2.git
|
repo: https://github.com/fedora-infra/mirrormanager2.git
|
||||||
|
|
||||||
- name: install reportmirror script
|
- name: Install reportmirror script
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
dest: /usr/local/bin/report_mirror
|
dest: /usr/local/bin/report_mirror
|
||||||
src: /usr/local/src/report_mirror/client/report_mirror
|
src: /usr/local/src/report_mirror/client/report_mirror
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
@ -18,16 +18,16 @@
|
||||||
group: "{{ ansible_wheel }}"
|
group: "{{ ansible_wheel }}"
|
||||||
remote_src: true
|
remote_src: true
|
||||||
|
|
||||||
- name: create reportmirror config directory
|
- name: Create reportmirror config directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
dest: /etc/mirrormanager-client
|
dest: /etc/mirrormanager-client
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0750
|
mode: 0750
|
||||||
owner: root
|
owner: root
|
||||||
group: mirror
|
group: mirror
|
||||||
|
|
||||||
- name: create reportmirror config from template
|
- name: Create reportmirror config from template
|
||||||
template:
|
ansible.builtin.template:
|
||||||
dest: /etc/mirrormanager-client/report_mirror.conf
|
dest: /etc/mirrormanager-client/report_mirror.conf
|
||||||
src: report_mirror.conf.j2
|
src: report_mirror.conf.j2
|
||||||
mode: 0640
|
mode: 0640
|
||||||
|
|
|
@ -1,23 +1,22 @@
|
||||||
---
|
---
|
||||||
|
- name: Create config for {{ label }}
|
||||||
- name: create config for {{ label }}
|
ansible.builtin.template:
|
||||||
template:
|
|
||||||
dest: "/etc/sync-mirrors/{{ label }}.conf"
|
dest: "/etc/sync-mirrors/{{ label }}.conf"
|
||||||
src: mirror.conf.j2
|
src: mirror.conf.j2
|
||||||
mode: 0644
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: create target directory
|
- name: Create target directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "/srv/mirrors/{{ label }}"
|
path: "/srv/mirrors/{{ label }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: mirror
|
owner: mirror
|
||||||
group: mirror
|
group: mirror
|
||||||
|
|
||||||
- name: link target directory to web
|
- name: Link target directory to web
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "/srv/web/{{ inventory_hostname }}/{{ label }}"
|
path: "/srv/web/{{ inventory_hostname }}/{{ label }}"
|
||||||
src: "/srv/mirrors/{{ label }}"
|
src: "/srv/mirrors/{{ label }}"
|
||||||
state: link
|
state: link
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
---
|
---
|
||||||
- name: install required packages
|
- name: Install required packages
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: installed
|
state: installed
|
||||||
with_items:
|
with_items:
|
||||||
- unzip
|
- unzip
|
||||||
- createrepo_c
|
- createrepo_c
|
||||||
|
|
||||||
- name: create target directory
|
- name: Create target directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /srv/mirrors/thinlinc
|
path: /srv/mirrors/thinlinc
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: mirror
|
owner: mirror
|
||||||
group: mirror
|
group: mirror
|
||||||
|
|
||||||
- name: link target directory
|
- name: Link target directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
dest: /srv/web/{{ inventory_hostname }}/thinlinc
|
dest: /srv/web/{{ inventory_hostname }}/thinlinc
|
||||||
src: /srv/mirrors/thinlinc
|
src: /srv/mirrors/thinlinc
|
||||||
state: link
|
state: link
|
||||||
|
@ -24,16 +24,16 @@
|
||||||
group: "{{ ansible_wheel }}"
|
group: "{{ ansible_wheel }}"
|
||||||
follow: false
|
follow: false
|
||||||
|
|
||||||
- name: copy sync script
|
- name: Copy sync script
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
dest: /usr/local/bin/sync-thinlinc-repo
|
dest: /usr/local/bin/sync-thinlinc-repo
|
||||||
src: sync-thinlinc-repo
|
src: sync-thinlinc-repo
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: create sync cron job
|
- name: Create sync cron job
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: sync-thinlinc-repo
|
name: sync-thinlinc-repo
|
||||||
hour: "4"
|
hour: "4"
|
||||||
minute: "5"
|
minute: "5"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue