Blame SPECS/ansible-collection-microsoft-sql.spec

d92ff1
# NOTE: Even though ansible-core is in 8.6, it is only available
d92ff1
# at *runtime*, not at *buildtime* - so we can't have
d92ff1
# ansible-core as a build_dep on RHEL8
d92ff1
%if 0%{?fedora} || 0%{?rhel} >= 9
d92ff1
%bcond_without ansible
d92ff1
%global ansible_build_dep ansible-core >= 2.11.0
d92ff1
%else
d92ff1
%if 0%{?rhel} && ! 0%{?epel}
d92ff1
%bcond_with ansible
d92ff1
%else
d92ff1
%bcond_without ansible
d92ff1
%global ansible_build_dep ansible >= 2.9.10
d92ff1
%endif
d92ff1
%endif
d92ff1
d92ff1
%bcond_with collection_artifact
d92ff1
d92ff1
# Do not convert .md to .html on RHEL 7 because tools the conversion are not available
d92ff1
%if 0%{?fedora} || 0%{?rhel} >= 8
d92ff1
%bcond_without html
d92ff1
%else
d92ff1
%bcond_with html
d92ff1
%endif
d92ff1
d92ff1
Name: ansible-collection-microsoft-sql
d92ff1
Url: https://github.com/linux-system-roles/mssql
d92ff1
Summary: The Ansible collection for Microsoft SQL Server management
55879b
Version: 1.2.4
55879b
Release: 1%{?dist}
d92ff1
d92ff1
#Group: Development/Libraries
d92ff1
License: MIT
d92ff1
%global installbase %{_datadir}/microsoft
d92ff1
%global _pkglicensedir %{_licensedir}/%{name}
d92ff1
d92ff1
%global collection_namespace microsoft
d92ff1
%global collection_name sql
d92ff1
d92ff1
%global collection_version %{version}
d92ff1
d92ff1
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
d92ff1
# Not available on RHEL, so we must define those macros locally here without using ansible-galaxy
d92ff1
d92ff1
# Not used (yet). Could be made to point to AH in RHEL - but what about CentOS Stream?
d92ff1
#%%{!?ansible_collection_url:%%define ansible_collection_url() https://galaxy.ansible.com/%%{collection_namespace}/%%{collection_name}}
d92ff1
d92ff1
%if 0%{?fedora} || 0%{?rhel} >= 8
d92ff1
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
d92ff1
%else
d92ff1
# Define undefined macro using "!?ansible_collection_files:..." does not work for rhel-7
d92ff1
%if %{?ansible_collection_files:0}%{!?ansible_collection_files:1}
d92ff1
%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/
d92ff1
%endif
d92ff1
%endif
d92ff1
d92ff1
# ansible-core is in rhel 8.6 and later - default to ansible-core, but allow
d92ff1
# the use of ansible if present - we may revisit this if the automatic dependency
d92ff1
# generator is added to ansible-core in RHEL
d92ff1
# Fedora - the automatic generator will add this - no need to explicit declare
d92ff1
# it in the spec file
d92ff1
# EL7 - no dependency on ansible because there is no ansible in el7 - user is
d92ff1
# responsible for knowing they have to install ansible
d92ff1
%if 0%{?rhel} >= 8
d92ff1
Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0)
d92ff1
%endif
55879b
55879b
%if 0%{?fedora}
55879b
Requires: linux-system-roles
55879b
%else
55879b
Requires: rhel-system-roles
55879b
%endif
55879b
d92ff1
%if %{with ansible}
d92ff1
BuildRequires: %{ansible_build_dep}
d92ff1
%endif
d92ff1
d92ff1
%if %{without ansible}
d92ff1
# We don't have ansible-galaxy.
d92ff1
# Simply copy everything instead of galaxy-installing the built artifact.
d92ff1
%define ansible_collection_build_install() tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz .; mkdir -p %{buildroot}%{ansible_collection_files}%{collection_name}; (cd %{buildroot}%{ansible_collection_files}%{collection_name}; tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz)
d92ff1
%else
d92ff1
%define ansible_collection_build_install() ansible-galaxy collection build; ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
d92ff1
%endif
d92ff1
55879b
# For each role, call defsource() and the point to it with SourceN: %{archiveurlN}.
d92ff1
%global archiveext tar.gz
d92ff1
# list of source role names
d92ff1
%global rolenames %nil
d92ff1
# list of assignments that can be used to populate a bash associative array variable
d92ff1
%global rolestodir %nil
d92ff1
# list of target rolenames to copy the roles to
d92ff1
%global target_rolenames %nil
d92ff1
# list of collection rolenames to convert the roles to
d92ff1
%global collection_rolenames %nil
d92ff1
d92ff1
%define getarchivedir() %(p=%{basename:%{S:%{1}}}; echo ${p%%.%{archiveext}})
d92ff1
d92ff1
%global parenturl https://github.com/linux-system-roles
d92ff1
55879b
# You can feed either tag or commit to defsource
55879b
%define defsource() %{expand:%%global ref%{1} %{2}
d92ff1
%%global extractdir%{1} %%{expand:%%getarchivedir %{1}}
d92ff1
%%global archiveurl%{1} %%{parenturl}/%%{rolename%{1}}/archive/%%{ref%{1}}/%%{rolename%{1}}-%%{ref%{1}}.tar.gz
d92ff1
%%global rolenames %%{?rolenames} %%{rolename%{1}}
d92ff1
%%global roletodir%{1} [%{rolename%{1}}]="%{extractdir%{1}}"
d92ff1
%%global rolestodir %%{?rolestodir} %{roletodir%{1}}
d92ff1
%%{!?target_rolename%{1}:%%global target_rolename%{1} %%{rolename%{1}}}
d92ff1
%%global target_rolenames %%{?target_rolenames} [%{rolename%{1}}]="%{target_rolename%{1}}"
d92ff1
%%{!?collection_rolename%{1}:%%global collection_rolename%{1} %%{rolename%{1}}}
d92ff1
%%global collection_rolenames %%{?collection_rolenames} [%{rolename%{1}}]="%{collection_rolename%{1}}"
d92ff1
}
d92ff1
55879b
%defsource 1 1.2.4
d92ff1
%global rolename1 mssql
d92ff1
%global target_rolename1 sql-server
d92ff1
%global collection_rolename1 server
d92ff1
d92ff1
%global mainid cdc706f14614ef5e80bbce8db10beb369e889df9
d92ff1
Source: %{parenturl}/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
d92ff1
Source1: %{archiveurl1}
d92ff1
d92ff1
BuildArch: noarch
d92ff1
d92ff1
%if %{with html}
d92ff1
# Requirements for md2html.sh to build the documentation
d92ff1
%if 0%{?fedora} || 0%{?rhel} >= 9
d92ff1
BuildRequires: rubygem-kramdown-parser-gfm
d92ff1
%else
d92ff1
BuildRequires: pandoc
d92ff1
BuildRequires: asciidoc
d92ff1
BuildRequires: highlight
d92ff1
%endif
d92ff1
%endif
d92ff1
d92ff1
# Requirements for galaxy_transform.py
d92ff1
BuildRequires: python3
d92ff1
%if 0%{?fedora} || 0%{?rhel} >= 8
55879b
BuildRequires: %{py3_dist ruamel.yaml}
d92ff1
%else
d92ff1
BuildRequires: python3-ruamel-yaml
d92ff1
%endif
d92ff1
d92ff1
%if %{undefined __ansible_provides}
d92ff1
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{collection_version}
d92ff1
%endif
d92ff1
# be compatible with the usual Fedora Provides:
d92ff1
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release}
d92ff1
d92ff1
%description
d92ff1
This RPM installs the Ansible collection for Microsoft SQL Server management
d92ff1
microsoft.sql. This RPM also installs the roles provided by the collection in
d92ff1
the legacy roles format for users of Ansible < 2.9.
d92ff1
d92ff1
%if %{with collection_artifact}
d92ff1
%package collection-artifact
d92ff1
Summary: Collection artifact to import to Automation Hub / Ansible Galaxy
d92ff1
d92ff1
%description collection-artifact
d92ff1
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{version}.tar.gz
d92ff1
%endif
d92ff1
d92ff1
%prep
d92ff1
%setup -q -a1 -n %{getarchivedir 0}
d92ff1
d92ff1
# Declare the array containing names of directories to copy roles to for prep
d92ff1
declare -A ROLESTODIR=(%{rolestodir})
d92ff1
for rolename in %{rolenames}; do
d92ff1
    mv "${ROLESTODIR[${rolename}]}" ${rolename}
d92ff1
done
d92ff1
d92ff1
# Removing symlinks in tests/roles
d92ff1
for rolename in %{rolenames}; do
d92ff1
    if [ -d ${rolename}/tests/roles ]; then
d92ff1
        find ${rolename}/tests/roles -type l -exec rm {} \;
d92ff1
        if [ -d ${rolename}/tests/roles/linux-system-roles.${rolename} ]; then
d92ff1
            rm -r ${rolename}/tests/roles/linux-system-roles.${rolename}
d92ff1
        fi
d92ff1
    fi
d92ff1
done
d92ff1
d92ff1
# transform ambiguous #!/usr/bin/env python shebangs to python3 to stop brp-mangle-shebangs complaining
d92ff1
find -type f -executable -name '*.py' -exec \
d92ff1
     sed -i -r -e '1s@^(#! */usr/bin/env python)(\s|$)@#\13\2@' '{}' +
d92ff1
d92ff1
%build
d92ff1
%if %{with html}
d92ff1
# Convert README.md to README.html in the source roles
d92ff1
readmes=""
d92ff1
for rolename in %{rolenames}; do
d92ff1
    readmes="${readmes} $rolename/README.md"
d92ff1
done
d92ff1
sh md2html.sh $readmes
d92ff1
%endif
d92ff1
d92ff1
mkdir .collections
d92ff1
# Copy README.md for the collection build
d92ff1
cp %{rolename1}/.collection/README.md lsr_role2collection/collection_readme.md
d92ff1
# Copy galaxy.yml for the collection build
d92ff1
cp %{rolename1}/.collection/galaxy.yml ./
55879b
d92ff1
# Ensure the correct entries in galaxy.yml
55879b
%if 0%{?rhel}
55879b
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
55879b
                      "Ansible collection for Microsoft SQL Server management" \
55879b
                      "https://github.com/linux-system-roles/mssql" \
55879b
                      "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/administration_and_configuration_tasks_using_system_roles_in_rhel/assembly_configuring-microsoft-sql-server-using-microsoft-sql-server-ansible-role_assembly_updating-packages-to-enable-automation-for-the-rhel-system-roles" \
55879b
                      "https://github.com/linux-system-roles/mssql/blob/master/README.md" \
55879b
                      "https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&component=ansible-collection-microsoft-sql" \
55879b
                      > galaxy.yml.tmp
55879b
%else
55879b
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
55879b
                      "Ansible collection for Microsoft SQL Server management" \
55879b
                      > galaxy.yml.tmp
55879b
%endif
d92ff1
mv galaxy.yml.tmp galaxy.yml
d92ff1
d92ff1
# Declare the array containing collection rolenames to convert roles to
d92ff1
declare -A COLLECTION_ROLENAMES=(%{collection_rolenames})
d92ff1
55879b
# Replace fedora.linux_system_roles with redhat.rhel_system_roles
55879b
%if 0%{?rhel}
55879b
for rolename in %{rolenames}; do
55879b
    sed -i 's/fedora\.linux_system_roles/redhat.rhel_system_roles/g' \
55879b
    $rolename/CHANGELOG.md \
55879b
    $rolename/README.md \
55879b
    $rolename/tasks/*.yml \
55879b
    $rolename/tests/*.yml \
55879b
    $rolename/meta/*.yml
55879b
done
55879b
%endif
55879b
d92ff1
# Convert roles to the collection format
d92ff1
for rolename in %{rolenames}; do
d92ff1
    python3 lsr_role2collection.py --role "$rolename" \
d92ff1
        --src-path "$rolename" \
d92ff1
        --src-owner linux-system-roles \
d92ff1
        --dest-path .collections \
d92ff1
        --readme lsr_role2collection/collection_readme.md \
d92ff1
        --namespace %{collection_namespace} --collection %{collection_name} \
d92ff1
        --new-role "${COLLECTION_ROLENAMES[${rolename}]}" \
d92ff1
        --meta-runtime lsr_role2collection/runtime.yml
d92ff1
done
d92ff1
d92ff1
# removing dot files/dirs
d92ff1
rm -r .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.[A-Za-z]*
d92ff1
d92ff1
# Copy galaxy.yml to the collection directory
d92ff1
cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name}
d92ff1
55879b
# Copy CHANGELOG.md from mssql to collection dir
55879b
mv .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{collection_rolename1}/CHANGELOG.md \
55879b
    .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
55879b
d92ff1
%install
d92ff1
mkdir -p $RPM_BUILD_ROOT%{installbase}
d92ff1
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles
d92ff1
d92ff1
# Declare the array containing target rolenames to copy roles to
d92ff1
declare -A TARGET_ROLENAMES=(%{target_rolenames})
d92ff1
d92ff1
# Copy roles to the target directory within the microsoft directory and rename
d92ff1
for rolename in %{rolenames}; do
d92ff1
    cp -pR "$rolename" "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}"
d92ff1
    sed -i "s/linux-system-roles\.$rolename/microsoft\.${TARGET_ROLENAMES[${rolename}]}/g" \
d92ff1
      $RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/tests/*.yml
d92ff1
done
d92ff1
d92ff1
# Generate symlinks for roles in /usr/share/ansible/roles
d92ff1
for rolename in %{rolenames}; do
d92ff1
    ln -s "%{installbase}/${TARGET_ROLENAMES[${rolename}]}" "$RPM_BUILD_ROOT%{_datadir}/ansible/roles/microsoft.${TARGET_ROLENAMES[${rolename}]}"
d92ff1
done
d92ff1
d92ff1
# Copy README, COPYING, and LICENSE files to the corresponding directories
d92ff1
mkdir -p $RPM_BUILD_ROOT%{_pkglicensedir}
d92ff1
for rolename in %{rolenames}; do
d92ff1
    mkdir -p "$RPM_BUILD_ROOT%{_pkgdocdir}/${TARGET_ROLENAMES[${rolename}]}"
d92ff1
    cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/README.md" \
d92ff1
       "$RPM_BUILD_ROOT%{_pkgdocdir}/${TARGET_ROLENAMES[${rolename}]}"
d92ff1
%if %{with html}
d92ff1
    cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/README.html" \
d92ff1
       "$RPM_BUILD_ROOT%{_pkgdocdir}/${TARGET_ROLENAMES[${rolename}]}"
d92ff1
%endif
d92ff1
    if [ -f "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/COPYING" ]; then
d92ff1
        cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/COPYING" \
d92ff1
           "$RPM_BUILD_ROOT%{_pkglicensedir}/${TARGET_ROLENAMES[${rolename}]}.COPYING"
d92ff1
    fi
d92ff1
    if [ -f "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/LICENSE" ]; then
d92ff1
        cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/LICENSE" \
d92ff1
           "$RPM_BUILD_ROOT%{_pkglicensedir}/${TARGET_ROLENAMES[${rolename}]}.LICENSE"
d92ff1
    fi
d92ff1
done
d92ff1
d92ff1
# Remove dot files
d92ff1
rm -r $RPM_BUILD_ROOT%{installbase}/*/.[A-Za-z]*
d92ff1
d92ff1
# Remove the molecule directory
d92ff1
rm -r $RPM_BUILD_ROOT%{installbase}/*/molecule
d92ff1
d92ff1
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
d92ff1
%ansible_collection_build_install
d92ff1
popd
d92ff1
d92ff1
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection
d92ff1
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles
d92ff1
d92ff1
# Copy the collection README files to the collection
d92ff1
cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/README.md \
d92ff1
   $RPM_BUILD_ROOT%{_pkgdocdir}/collection
d92ff1
d92ff1
# Declare the array containing collection rolenames to convert roles to
d92ff1
declare -A COLLECTION_ROLENAMES=(%{collection_rolenames})
d92ff1
d92ff1
for rolename in %{rolenames}; do
d92ff1
  if [ -f "%{buildroot}%{ansible_collection_files}%{collection_name}/roles/${COLLECTION_ROLENAMES[${rolename}]}/README.md" ]; then
d92ff1
    mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${COLLECTION_ROLENAMES[${rolename}]}
d92ff1
    cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${COLLECTION_ROLENAMES[${rolename}]}/README.md \
d92ff1
        $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${COLLECTION_ROLENAMES[${rolename}]}
d92ff1
  fi
d92ff1
done
d92ff1
d92ff1
%if %{with html}
d92ff1
# converting README.md to README.html for collection in $RPM_BUILD_ROOT%{_pkgdocdir}/collection
d92ff1
readmes="$RPM_BUILD_ROOT%{_pkgdocdir}/collection/README.md"
d92ff1
for rolename in %{rolenames}; do
d92ff1
    readmes="${readmes} $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${COLLECTION_ROLENAMES[${rolename}]}/README.md"
d92ff1
done
d92ff1
sh md2html.sh $readmes
d92ff1
%endif
d92ff1
d92ff1
%if %{with collection_artifact}
d92ff1
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
d92ff1
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
d92ff1
if [ -f %{collection_namespace}-%{collection_name}-%{version}.tar.gz ]; then
d92ff1
    mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \
d92ff1
       $RPM_BUILD_ROOT%{_datadir}/ansible/collections/
d92ff1
fi
d92ff1
popd
d92ff1
%endif
d92ff1
d92ff1
# generate the %files section in the file files_section.txt
d92ff1
format_item_for_files() {
d92ff1
    # $1 is directory or file name in buildroot
d92ff1
    # $2 - if true, and item is a directory, use %dir
d92ff1
    local item
d92ff1
    local files_item
d92ff1
    item="$1"
d92ff1
    files_item=${item##"%{buildroot}"}
d92ff1
    if [ -L "$item" ]; then
d92ff1
        echo "$files_item"
d92ff1
    elif [ -d "$item" ]; then
d92ff1
        if [[ "$item" == */doc* ]]; then
d92ff1
            echo "%doc $files_item"
d92ff1
        elif [ "${2:-false}" = true ]; then
d92ff1
            echo "%dir $files_item"
d92ff1
        else
d92ff1
            echo "$files_item"
d92ff1
        fi
d92ff1
    elif [[ "$item" == */README.md ]] || [[ "$item" == */README.html ]]; then
d92ff1
        if [[ "$item" == */private_* ]]; then
d92ff1
            # mark as regular file, not %doc
d92ff1
            echo "$files_item"
d92ff1
        else
d92ff1
            echo "%doc $files_item"
d92ff1
        fi
d92ff1
    elif [[ "$item" != */COPYING* ]] && [[ "$item" != */LICENSE* ]]; then
d92ff1
        # Avoid dynamically using the license macro since the license macro
d92ff1
        # is replaced with the value of License directive in the older rpmbuild.
d92ff1
        echo "$files_item"
d92ff1
    fi
d92ff1
}
d92ff1
d92ff1
files_section=files_section.txt
d92ff1
rm -f $files_section
d92ff1
touch $files_section
d92ff1
%if %{without ansible}
d92ff1
echo '%dir %{_datadir}/ansible' >> $files_section
d92ff1
echo '%dir %{_datadir}/ansible/roles' >> $files_section
d92ff1
%endif
d92ff1
%if "%{installbase}" != "%{_datadir}/ansible/roles"
d92ff1
echo '%dir %{installbase}' >> $files_section
d92ff1
%endif
d92ff1
echo '%dir %{ansible_collection_files}' >> $files_section
d92ff1
echo '%dir %{ansible_collection_files}%{collection_name}' >> $files_section
d92ff1
find %{buildroot}%{ansible_collection_files}%{collection_name} -mindepth 1 -maxdepth 1 | \
d92ff1
    while read item; do
d92ff1
        if [[ "$item" == */roles ]]; then
d92ff1
            format_item_for_files "$item" true >> $files_section
d92ff1
            find "$item" -mindepth 1 -maxdepth 1 | while read roles_dir; do
d92ff1
                format_item_for_files "$roles_dir" true >> $files_section
d92ff1
                find "$roles_dir" -mindepth 1 -maxdepth 1 | while read roles_item; do
d92ff1
                    format_item_for_files "$roles_item" >> $files_section
d92ff1
                done
d92ff1
            done
d92ff1
        else
d92ff1
            format_item_for_files "$item" >> $files_section
d92ff1
        fi
d92ff1
    done
d92ff1
d92ff1
find %{buildroot}%{installbase} -mindepth 1 -maxdepth 1 | \
d92ff1
    while read item; do
d92ff1
        if [ -d "$item" ]; then
d92ff1
            format_item_for_files "$item" true >> $files_section
d92ff1
            find "$item" -mindepth 1 -maxdepth 1 | while read roles_item; do
d92ff1
                format_item_for_files "$roles_item" >> $files_section
d92ff1
            done
d92ff1
        else
d92ff1
            format_item_for_files "$item" >> $files_section
d92ff1
        fi
d92ff1
    done
d92ff1
if [ "%{installbase}" != "%{_datadir}/ansible/roles" ]; then
d92ff1
    find %{buildroot}%{_datadir}/ansible/roles -mindepth 1 -maxdepth 1 | \
d92ff1
        while read item; do
d92ff1
            if [ -d "$item" ]; then
d92ff1
                format_item_for_files "$item" true >> $files_section
d92ff1
                find "$item" -mindepth 1 -maxdepth 1 | while read roles_item; do
d92ff1
                    format_item_for_files "$roles_item" >> $files_section
d92ff1
                done
d92ff1
            else
d92ff1
                format_item_for_files "$item" >> $files_section
d92ff1
            fi
d92ff1
        done
d92ff1
fi
d92ff1
# cat files_section.txt
d92ff1
# done with files_section.txt generation
d92ff1
d92ff1
%files -f files_section.txt
d92ff1
%{_pkgdocdir}/*/README.md
d92ff1
%{_pkgdocdir}/collection/roles/*/README.md
d92ff1
%if %{with html}
d92ff1
%{_pkgdocdir}/*/README.html
d92ff1
%{_pkgdocdir}/collection/roles/*/README.html
d92ff1
%endif
d92ff1
%license %{_pkglicensedir}/*
d92ff1
%license %{installbase}/*/LICENSE*
d92ff1
%license %{ansible_collection_files}/%{collection_name}/LICENSE*
d92ff1
d92ff1
%if %{with collection_artifact}
d92ff1
%files collection-artifact
d92ff1
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{version}.tar.gz
d92ff1
%endif
d92ff1
d92ff1
%changelog
55879b
* Thu Sep 1 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.4-1
55879b
- Replicate all provided databases
55879b
  - This change fixes the bug where only the first database provided with
55879b
mssql_ha_db_names got replicated
55879b
  - Clarify that the role does not remove not listed databases
55879b
  Resolves: rhbz#2066337
55879b
- Input multiple sql scripts
55879b
  - Allow _input_sql_file vars to accept list of files
55879b
  - Flush handlers prior to inputting post sql script
55879b
  Resolves: rhbz#2120712
55879b
- Note that ha_cluster is not idempotent
55879b
- SPEC: Do not update dates in CHANGELOG.md
55879b
55879b
* Thu Aug 25 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.3-1
55879b
- Use firewall role to configure firewall for SQL Server
55879b
  Resolves: rhbz#2120709
55879b
- Add mssql_ha_virtual_ip
55879b
  Replace mssql_ha_db_name with mssql_ha_db_names to let users replicate multiple DBs
55879b
  Resolves: rhbz#2066337
55879b
55879b
- Replace simple `mssql_input_sql_file` with `pre` and `post` variables
55879b
  Resolves: rhbz#2120712
55879b
- Add Requires: linux-system-roles or rhel-system-roles
55879b
- Replace fedora.linux_system_roles:redhat.rhel_system_roles on RHEL
55879b
- Add downstream values to galaxy.yml
55879b
- Change defcommit to defsource that takes both tags and commits
55879b
- Update CHANGELOG.md with the current date and copy it to collection dir
55879b
55879b
* Mon Jul 4 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.0-2
55879b
- Update mssql commit
55879b
  Resolves: rhbz#2066337
55879b
- Add condition for upstream spec build for galaxy_transform
55879b
- Replace extra-mapping with replacing in the legacy format with sed
55879b
55879b
* Fri Jun 17 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.0-1
55879b
- Add MVP HA functionality to the server role
55879b
  Resolves: rhbz#2066337
55879b
- Add mssql_tls_remote_src to the server role
55879b
  Resolves: rhbz#2098212
55879b
- Add Requires: linux-system-roles or rhel-system-roles
55879b
- Add downstream values to galaxy.yml
55879b
d92ff1
* Mon Mar 21 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.1.1-3
d92ff1
- Fix inserting ansible_managed
55879b
  Resolves: rhbz#2057652
d92ff1
- Users now can provide a custom URLs to pull packages and RPM key from
55879b
  Resolves: rhbz#2070452
55879b
- Add "Requires: ansible-core or ansible"
55879b
  Resolves: rhbz#2067496
55879b
d92ff1
d92ff1
* Fri Mar 18 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.1.1-2
d92ff1
- RHEL8.6, 9 - add "Requires: ansible-core or ansible"
d92ff1
  Resolves: rhbz#2065669 (EL9)
d92ff1
d92ff1
* Thu Mar 17 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.1.1-1
d92ff1
- Insert the "Ansible managed" comment to the /var/opt/mssql/mssql.conf file
d92ff1
  Resolves rhbz#2064690 (EL9)
d92ff1
d92ff1
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
d92ff1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
d92ff1
d92ff1
* Thu Sep 23 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.1.0-2
d92ff1
- Bump release to build with gating.yaml added
d92ff1
d92ff1
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
d92ff1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
d92ff1
d92ff1
* Wed Jul 21 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.1.0-1
d92ff1
- Add support for Microsoft SQL Server 2017
d92ff1
d92ff1
* Mon Jul 19 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.12-2
d92ff1
- Copy fix for RHEL 7 builds from rhel-system-roles
d92ff1
  Link to the original fix:
d92ff1
  https://src.fedoraproject.org/rpms/linux-system-roles/c/093981119f99ac51a6e06a2714b587e4e2fe287c
d92ff1
d92ff1
* Tue Jul 13 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.12-1
d92ff1
- Add the meta-runtime option from the latest auto-maintenance
d92ff1
- Use the latest mssql that ships fixes for issues #24,#25,#26,#27,#28,35
d92ff1
d92ff1
* Tue Jun 29 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.11-3
d92ff1
- Add a missing slash at the {ansible_collection_files} definition for rhel 7
d92ff1
d92ff1
* Thu Jun 17 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.11-2
d92ff1
- Make the ansible_collection_files macro defined in Fedora automatically and
d92ff1
  in RHEL manually consistent - having slash at the end to clean double-slashes
d92ff1
d92ff1
* Thu Jun 17 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.11-1
d92ff1
- Update the version to be consistent with the Galaxy collection at
d92ff1
  https://galaxy.ansible.com/microsoft/sql
d92ff1
d92ff1
* Wed Jun 16 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-5
d92ff1
- Update commit hash for mssql
d92ff1
d92ff1
* Wed Jun 16 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-4
d92ff1
- Generate symlinks for roles in /usr/share/ansible/roles
d92ff1
d92ff1
* Wed Jun 16 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-3
d92ff1
- Copy changes made to linux-system-roles in this PR:
d92ff1
  https://src.fedoraproject.org/rpms/linux-system-roles/pull-request/13#
d92ff1
- Make spec file available for older versions of OSes.
d92ff1
- Drop python3-six dependency which was used by lsr_role2collection.py.
d92ff1
- Drop html files from rpm if the version has no markdown parser.
d92ff1
- Drop unnecessary python scripts which include python3 only code, e.g.,
d92ff1
  f-strings.
d92ff1
  Resolves rhbz#1970165
d92ff1
d92ff1
* Mon Jun 14 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-2
d92ff1
- Fix long description lines
d92ff1
- Fix incorrect role includes in microsoft/sql-server/tests/
d92ff1
d92ff1
* Thu Jun 3 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-1
d92ff1
- Initial release