7880ba665e
openEuler is an open-source Linux based operating system. The current openEuler kernel is based on Linux and supports multi arch, such as X86_64 and aarch64. It fully unleashes the potential of computing chips. As an efficient, stable, and secure open-source OS built by global open-source contributors, openEuler applies to database, big data, cloud computing, and AI scenarios. openEuler is using RPM for package management. Note: Currently there is no available package for uwsgi-plugin-python3 and ovn, so that openEuler needs manually install them from source. Website: https://www.openeuler.org/en/ Change-Id: I169a0017998054604a63ac6c177d0f43f8a32ba6 Co-Authored-By: wangxiyuan <wangxiyuan1007@gmail.com> Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
91 lines
2.4 KiB
YAML
91 lines
2.4 KiB
YAML
- name: Ensure {{ stage_dir }}/apache exists
|
|
file:
|
|
path: "{{ stage_dir }}/apache"
|
|
state: directory
|
|
|
|
- name: Link apache logs on Debian/SuSE
|
|
block:
|
|
- name: Find logs
|
|
find:
|
|
path: "/var/log/apache2"
|
|
file_type: any
|
|
register: debian_suse_apache_logs
|
|
|
|
- name: Dereference files
|
|
stat:
|
|
path: "{{ item.path }}"
|
|
with_items: "{{ debian_suse_apache_logs.files }}"
|
|
register: debian_suse_apache_deref_logs
|
|
|
|
- name: Create hard links
|
|
file:
|
|
src: "{{ item.stat.lnk_source | default(item.stat.path) }}"
|
|
dest: "{{ stage_dir }}/apache/{{ item.stat.path | basename }}"
|
|
state: hard
|
|
with_items: "{{ debian_suse_apache_deref_logs.results }}"
|
|
when:
|
|
- item.stat.isreg or item.stat.islnk
|
|
when: ansible_os_family in ('Debian', 'Suse')
|
|
no_log: true
|
|
|
|
- name: Link apache logs on RedHat
|
|
block:
|
|
- name: Find logs
|
|
find:
|
|
path: "/var/log/httpd"
|
|
file_type: any
|
|
register: redhat_apache_logs
|
|
|
|
- name: Dereference files
|
|
stat:
|
|
path: "{{ item.path }}"
|
|
with_items: "{{ redhat_apache_logs.files }}"
|
|
register: redhat_apache_deref_logs
|
|
|
|
- name: Create hard links
|
|
file:
|
|
src: "{{ item.stat.lnk_source | default(item.stat.path) }}"
|
|
dest: "{{ stage_dir }}/apache/{{ item.stat.path | basename }}"
|
|
state: hard
|
|
with_items: "{{ redhat_apache_deref_logs.results }}"
|
|
when:
|
|
- item.stat.isreg or item.stat.islnk
|
|
when: ansible_os_family == 'RedHat'
|
|
no_log: true
|
|
|
|
- name: Ensure {{ stage_dir }}/apache_config apache_config exists
|
|
file:
|
|
path: "{{ stage_dir }}/apache_config"
|
|
state: directory
|
|
|
|
- name: Define config paths
|
|
set_fact:
|
|
apache_config_paths:
|
|
'Debian': '/etc/apache2/sites-enabled/'
|
|
'Suse': '/etc/apache2/conf.d/'
|
|
'RedHat': '/etc/httpd/conf.d/'
|
|
'openEuler': '/etc/httpd/conf.d/'
|
|
|
|
- name: Discover configurations
|
|
find:
|
|
path: "{{ apache_config_paths[ansible_os_family] }}"
|
|
file_type: any
|
|
register: apache_configs
|
|
no_log: true
|
|
|
|
- name: Dereference configurations
|
|
stat:
|
|
path: "{{ item.path }}"
|
|
with_items: "{{ apache_configs.files }}"
|
|
register: apache_configs_deref
|
|
no_log: true
|
|
|
|
- name: Link configurations
|
|
file:
|
|
src: "{{ item.stat.lnk_source | default(item.stat.path) }}"
|
|
dest: "{{ stage_dir }}/apache_config/{{ item.stat.path | basename }}"
|
|
state: hard
|
|
with_items: "{{ apache_configs_deref.results }}"
|
|
when: item.stat.isreg or item.stat.islnk
|
|
no_log: true
|