Browse Source

improve default configuration

master
parent
commit
138a994233
  1. 9
      ansible/ansible.cfg
  2. 23
      ansible/ansible.spec
  3. 9
      ansible/hosts

9
ansible/ansible.cfg

@ -0,0 +1,9 @@
##
## ansible.cfg -- global Ansible configuration
##
[defaults]
inventory = @l_prefix@/etc/ansible/hosts
interpreter_python = auto_silent

23
ansible/ansible.spec

@ -36,10 +36,12 @@ Class: EVAL
Group: SCM
License: GPL
Version: %{V_opkg}
Release: 20190523
Release: 20190526
# list of sources
Source0: https://github.com/ansible/ansible/archive/v%{V_dist}.tar.gz
Source1: ansible.cfg
Source2: hosts
# build information
BuildPreReq: OpenPKG, openpkg >= 20160101
@ -65,11 +67,30 @@ PreReq: python, python-net, python-text, python-yaml, python-setup, python
%setup -q -n ansible-%{V_dist}
%build
# adjust paths
%{l_shtool} subst \
-e 's;/etc/ansible/ansible\.cfg;%{l_prefix}/etc/ansible/ansible.cfg;' \
lib/ansible/config/manager.py
%{l_shtool} subst \
-e 's;/etc/ansible/hosts;%{l_prefix}/etc/ansible/hosts;' \
lib/ansible/config/base.yml \
lib/ansible/inventory/manager.py
%install
# install program
%{l_prefix}/bin/python setup.py install \
--root=$RPM_BUILD_ROOT \
--prefix=%{l_prefix}
# install default global configuration
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/ansible
%{l_shtool} install -c -m 644 %{l_value -s -a} \
%{SOURCE ansible.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/ansible/
%{l_shtool} install -c -m 644 %{l_value -s -a} \
%{SOURCE hosts} $RPM_BUILD_ROOT%{l_prefix}/etc/ansible/
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files

9
ansible/hosts

@ -0,0 +1,9 @@
##
## hosts -- Ansible hosts configuration
##
all:
hosts:
localhost:
ansible_python_interpreter: @l_prefix@/bin/python
Loading…
Cancel
Save