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