1
0
Fork 0

Some ansible lint fix

This commit is contained in:
Ethanell 2022-05-17 15:45:42 +02:00
parent c5cbb8382d
commit 4dbb5ffeb2
26 changed files with 79 additions and 446 deletions

View file

@ -1,6 +1,6 @@
---
- name: "Copy sample"
copy:
ansible.builtin.copy:
src: "{{ ansistrano_release_path.stdout }}/includes/sys.config.sample.php"
dest: "{{ ansistrano_release_path.stdout }}/includes/sys.config.php"
remote_src: true

View file

@ -4,14 +4,6 @@
command: install
working_dir: "{{ ansistrano_release_path.stdout }}"
- name: "Create npm home dir"
file:
path: "/var/www/.npm"
state: directory
owner: www-data
group: www-data
become_user: root
- name: "Install JS dependencies"
community.general.npm:
path: "{{ ansistrano_release_path.stdout }}"
@ -20,4 +12,4 @@
ansible.builtin.command:
cmd: "./node_modules/gulp/bin/gulp.js build"
chdir: "{{ ansistrano_release_path.stdout }}"
#Todo: creates: ""
creates: "{{ ansistrano_release_path.stdout }}/assets/css/main.css"

View file

@ -2,8 +2,8 @@ all:
hosts:
ubuntu:
scope: "prod"
#ubuntu1:
# scope: "test"
# ubuntu1:
# scope: "test"
vars:
release: "r1335"
db_name: "projectsend_{{ scope }}"

View file

@ -14,8 +14,8 @@
# Shared paths and basedir shared files creation.
# By default the shared paths directories and base directories for shared files are created automatically if not exists. But in some scenarios those paths could be symlinks to another directories in the filesystem, and the deployment process would fails. With these variables you can disable the involved tasks. If you have two or three shared paths, and don't need creation only for some of them, you always could disable the automatic creation and add a custom task in a hook.
ansistrano_ensure_shared_paths_exist: yes
ansistrano_ensure_basedirs_shared_files_exist: yes
ansistrano_ensure_shared_paths_exist: true
ansistrano_ensure_basedirs_shared_files_exist: true
# Deployment strategy - method used to deliver code. Options are copy, download, git, rsync, rsync_direct, svn, or s3.
ansistrano_deploy_via: git
@ -23,7 +23,7 @@
# The rsync_direct strategy omits a file copy on the target offering a slight speed increase if you are deploying to shared hosts, are experiancing bad file-performance, or serve static assets from the same host you deploy your app to and rsync many files.
# You can check all the options inside tasks/update-code folder!
ansistrano_allow_anonymous_stats: no
ansistrano_allow_anonymous_stats: false
ansistrano_git_repo: "https://github.com/projectsend/projectsend.git"
ansistrano_git_branch: master

View file

@ -1,51 +0,0 @@
language: python
services:
- docker
env:
- ANSIBLE_VERSION: "2.9.27"
- ANSIBLE_VERSION: "2.10.7"
- ANSIBLE_VERSION: "3.4.0"
- ANSIBLE_VERSION: "4.10.0"
- distribution: Ubuntu
distribution_version: bionic
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
ANSIBLE_VERSION: docker
- distribution: Ubuntu
distribution_version: xenial
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
ANSIBLE_VERSION: docker
- distribution: Debian
distribution_version: buster
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
ANSIBLE_VERSION: docker
before_install:
# Standard Local Testing Commands
- if [ "${ANSIBLE_VERSION}" != "docker" ]; then sudo apt-get -y install software-properties-common ; fi
- if [ "${ANSIBLE_VERSION}" != "docker" ]; then sudo apt-get -y install python-pip ; fi
- if [ "${ANSIBLE_VERSION}" != "docker" ]; then sudo pip install ansible==$ANSIBLE_VERSION ; fi
- if [ "${ANSIBLE_VERSION}" != "docker" ]; then ansible --version ; fi
# Docker Testing pull container.
- if [ "${ANSIBLE_VERSION}" == "docker" ]; then docker pull ansiblecheck/ansiblecheck:${distribution,,}-${distribution_version} ; fi
script:
# Local Testing Commands
- if [ "${ANSIBLE_VERSION}" != "docker" ]; then echo localhost > inventory ; fi
- if [ "${ANSIBLE_VERSION}" != "docker" ]; then ansible-playbook -i inventory --connection=local --become -v test/main.yml ; fi
# Docker Testing Commands
- if [ "${ANSIBLE_VERSION}" == "docker" ]; then container_id=$(mktemp) ; fi
# Start The Built Container In The Background
- if [ "${ANSIBLE_VERSION}" == "docker" ]; then docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ansiblecheck/ansiblecheck:"${distribution,,}"-"${distribution_version}" "${init}" > "${container_id}" ; fi
# Ansible syntax check.
- if [ "${ANSIBLE_VERSION}" == "docker" ]; then docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/test/main.yml --syntax-check ; fi
# Test role.
- if [ "${ANSIBLE_VERSION}" == "docker" ]; then docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/test/main.yml -v -e update_cache=1; fi
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -1,2 +0,0 @@
---
# handlers file for apt

View file

@ -1,52 +1,21 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: Florian Charlaix
description: Install global dependency with APT
company: IUT Lyon 1 la Doua
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
license: None
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: Debian
versions:
- 11
- 12
- name: Ubuntu
versions:
- 20.04.4
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View file

@ -1,2 +0,0 @@
---
# vars file for apt

View file

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -1,2 +0,0 @@
---
# handlers file for mariadb

View file

@ -1,52 +1,21 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: Florian Charlaix
description: Install and setup MariaDB
company: IUT Lyon 1 la Doua
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
license: None
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: Debian
versions:
- 11
- 12
- name: Ubuntu
versions:
- 20.04.4
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View file

@ -1,2 +0,0 @@
---
# vars file for mariadb

View file

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -1,52 +1,21 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: Florian Charlaix
description: Install and setup Nginx
company: IUT Lyon 1 la Doua
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
license: None
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: Debian
versions:
- 11
- 12
- name: Ubuntu
versions:
- 20.04.4
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View file

@ -21,7 +21,7 @@
- Reload Nginx
- name: "Disable default"
file:
ansible.builtin.file:
path: "/etc/nginx/sites-enabled/default"
state: absent
notify:
@ -36,8 +36,9 @@
- Reload Nginx
- name: "Create base dir"
file:
ansible.builtin.file:
path: "/var/www/{{ scope }}"
owner: www-data
group: www-data
mode: "0750"
state: directory

View file

@ -1,2 +0,0 @@
---
# vars file for nginx

View file

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -1,2 +0,0 @@
---
# handlers file for nodejs

View file

@ -1,52 +1,21 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: Florian Charlaix
description: Install NodeJS and NPM
company: IUT Lyon 1 la Doua
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
license: None
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: Debian
versions:
- 11
- 12
- name: Ubuntu
versions:
- 20.04.4
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View file

@ -6,3 +6,12 @@
- npm
update_cache: true
cache_valid_time: 86400
- name: "Create npm home dir for www-data"
ansible.builtin.file:
path: "/var/www/.npm"
state: directory
owner: www-data
group: www-data
mode: "0750"
become_user: root

View file

@ -1,2 +0,0 @@
---
# vars file for nodejs

View file

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View file

@ -1,2 +0,0 @@
---
# handlers file for php

View file

@ -1,52 +1,21 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: Florian Charlaix
description: Install and setup PHP
company: IUT Lyon 1 la Doua
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
license: None
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
platforms:
- name: Debian
versions:
- 11
- 12
- name: Ubuntu
versions:
- 20.04.4
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View file

@ -1,2 +0,0 @@
---
# vars file for php