Compare commits

..

31 Commits

Author SHA1 Message Date
4a7e980371 Add logseq 2022-11-05 10:53:54 +00:00
cd1168f3c2 Add better support for 32bit games 2022-11-05 10:53:39 +00:00
15b967fa0b Add lutris dependencies and heroic games launcher 2022-10-05 18:43:22 +01:00
880993db4e Add signal 2022-09-05 09:32:01 +01:00
ed8a660e3d Add lutris depends 2022-09-05 09:31:43 +01:00
d10d95fe44 Add lutris 2022-09-04 17:36:36 +01:00
be70506cec Add onlyoffice 2022-09-02 14:53:35 +01:00
0da0cc4119 Add legendary 2022-09-02 14:52:29 +01:00
7ea518be31 Add brave 2022-08-15 10:25:49 +01:00
be38e99af2 Add terminator 2022-08-15 10:25:31 +01:00
eccf9336e8 Add vscodium 2022-08-12 19:15:42 +01:00
e8a0c93a3e Add rbw and fix gum package name change 2022-08-12 11:26:17 +01:00
7f00f92776 Add git, gum and pingu to terminal apps 2022-07-30 20:48:26 +01:00
33956b8d53 Add gimp to graphics 2022-07-30 15:28:38 +01:00
df2d035c3e Move non-existing packages from alpine to arch 2022-07-30 15:26:54 +01:00
9e318ad677 Fix error on stratum no existing 2022-07-30 15:24:17 +01:00
f4bb962ba8 Implement terminal packages 2022-07-30 12:55:20 +01:00
5b4e57e5c5 Change some pacman configs 2022-07-21 17:25:55 +01:00
3b004e12ff Use replace instead of shell and sed 2022-07-19 16:46:24 +01:00
493665ab8e Add bedrock config changes 2022-07-19 16:39:37 +01:00
0a1a9796bf Add Pixelorama 2022-07-16 21:42:20 +01:00
e15e124853 Add clean tag to aid with skipping remaking stratas 2022-07-15 20:31:07 +01:00
59b057463d Add graphics packages 2022-07-15 20:30:23 +01:00
95e53786f9 Add development packages and godot 2022-07-15 20:28:23 +01:00
52ac5b7910 Add AUR support for arch 2022-07-15 13:11:34 +01:00
d128a1d8be Add arch linux 2022-07-15 12:54:08 +01:00
8d2677f575 Fix the yaml format 2022-07-15 12:47:46 +01:00
233b4ab196 Move to strata specific roles and configure alpine 2022-07-14 08:36:15 +01:00
02d4d676ec Make roles to fetch and backup stratums to reduce duplicate code 2022-07-13 22:04:45 +01:00
b6f3344689 Add basic bedrock fetch support 2022-07-13 21:14:54 +01:00
77948e867b Fix the playbook not running 2022-07-13 21:14:32 +01:00
15 changed files with 1031 additions and 2 deletions

369
library/apk.py Normal file
View File

@ -0,0 +1,369 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Kevin Brebanov <https://github.com/kbrebanov>
# Based on pacman (Afterburn <https://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>)
# and apt (Matthew Williams <matthew@flowroute.com>) modules.
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: apk
short_description: Manages apk packages
description:
- Manages I(apk) packages for Alpine Linux.
author: "Kevin Brebanov (@kbrebanov)"
options:
available:
description:
- During upgrade, reset versioned world dependencies and change logic to prefer replacing or downgrading packages (instead of holding them)
if the currently installed package is no longer available from any repository.
type: bool
default: no
name:
description:
- A package name, like C(foo), or multiple packages, like C(foo, bar).
type: list
elements: str
no_cache:
description:
- Do not use any local cache path.
type: bool
default: no
version_added: 1.0.0
repository:
description:
- A package repository or multiple repositories.
Unlike with the underlying apk command, this list will override the system repositories rather than supplement them.
type: list
elements: str
state:
description:
- Indicates the desired package(s) state.
- C(present) ensures the package(s) is/are present. C(installed) can be used as an alias.
- C(absent) ensures the package(s) is/are absent. C(removed) can be used as an alias.
- C(latest) ensures the package(s) is/are present and the latest version(s).
default: present
choices: [ "present", "absent", "latest", "installed", "removed" ]
type: str
update_cache:
description:
- Update repository indexes. Can be run with other steps or on it's own.
type: bool
default: no
upgrade:
description:
- Upgrade all installed packages to their latest version.
type: bool
default: no
world:
description:
- Use a custom world file when checking for explicitly installed packages
type: str
default: /etc/apk/world
notes:
- 'I(name) and I(upgrade) are mutually exclusive.'
- When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''
- name: Update repositories and install foo package
community.general.apk:
name: foo
update_cache: yes
- name: Update repositories and install foo and bar packages
community.general.apk:
name: foo,bar
update_cache: yes
- name: Remove foo package
community.general.apk:
name: foo
state: absent
- name: Remove foo and bar packages
community.general.apk:
name: foo,bar
state: absent
- name: Install the package foo
community.general.apk:
name: foo
state: present
- name: Install the packages foo and bar
community.general.apk:
name: foo,bar
state: present
- name: Update repositories and update package foo to latest version
community.general.apk:
name: foo
state: latest
update_cache: yes
- name: Update repositories and update packages foo and bar to latest versions
community.general.apk:
name: foo,bar
state: latest
update_cache: yes
- name: Update all installed packages to the latest versions
community.general.apk:
upgrade: yes
- name: Upgrade / replace / downgrade / uninstall all installed packages to the latest versions available
community.general.apk:
available: yes
upgrade: yes
- name: Update repositories as a separate step
community.general.apk:
update_cache: yes
- name: Install package from a specific repository
community.general.apk:
name: foo
state: latest
update_cache: yes
repository: http://dl-3.alpinelinux.org/alpine/edge/main
- name: Install package without using cache
community.general.apk:
name: foo
state: latest
no_cache: yes
- name: Install package checking a custom world
community.general.apk:
name: foo
state: latest
world: /etc/apk/world.custom
'''
RETURN = '''
packages:
description: a list of packages that have been changed
returned: when packages have changed
type: list
sample: ['package', 'other-package']
'''
import re
# Import module snippets.
from ansible.module_utils.basic import AnsibleModule
def parse_for_packages(stdout):
packages = []
data = stdout.split('\n')
regex = re.compile(r'^\(\d+/\d+\)\s+\S+\s+(\S+)')
for l in data:
p = regex.search(l)
if p:
packages.append(p.group(1))
return packages
def update_package_db(module, exit):
cmd = "%s update" % (APK_PATH)
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
if rc != 0:
module.fail_json(msg="could not update package db", stdout=stdout, stderr=stderr)
elif exit:
module.exit_json(changed=True, msg='updated repository indexes', stdout=stdout, stderr=stderr)
else:
return True
def query_toplevel(module, name, world):
# world contains a list of top-level packages separated by ' ' or \n
# packages may contain repository (@) or version (=<>~) separator characters or start with negation !
regex = re.compile(r'^' + re.escape(name) + r'([@=<>~].+)?$')
with open(world) as f:
content = f.read().split()
for p in content:
if regex.search(p):
return True
return False
def query_package(module, name):
cmd = "%s -v info --installed %s" % (APK_PATH, name)
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
if rc == 0:
return True
else:
return False
def query_latest(module, name):
cmd = "%s version %s" % (APK_PATH, name)
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
search_pattern = r"(%s)-[\d\.\w]+-[\d\w]+\s+(.)\s+[\d\.\w]+-[\d\w]+\s+" % (re.escape(name))
match = re.search(search_pattern, stdout)
if match and match.group(2) == "<":
return False
return True
def query_virtual(module, name):
cmd = "%s -v info --description %s" % (APK_PATH, name)
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
search_pattern = r"^%s: virtual meta package" % (re.escape(name))
if re.search(search_pattern, stdout):
return True
return False
def get_dependencies(module, name):
cmd = "%s -v info --depends %s" % (APK_PATH, name)
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
dependencies = stdout.split()
if len(dependencies) > 1:
return dependencies[1:]
else:
return []
def upgrade_packages(module, available):
if module.check_mode:
cmd = "%s upgrade --simulate" % (APK_PATH)
else:
cmd = "%s upgrade" % (APK_PATH)
if available:
cmd = "%s --available" % cmd
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
packagelist = parse_for_packages(stdout)
if rc != 0:
module.fail_json(msg="failed to upgrade packages", stdout=stdout, stderr=stderr, packages=packagelist)
if re.search(r'^OK', stdout):
module.exit_json(changed=False, msg="packages already upgraded", stdout=stdout, stderr=stderr, packages=packagelist)
module.exit_json(changed=True, msg="upgraded packages", stdout=stdout, stderr=stderr, packages=packagelist)
def install_packages(module, names, state, world):
upgrade = False
to_install = []
to_upgrade = []
for name in names:
# Check if virtual package
if query_virtual(module, name):
# Get virtual package dependencies
dependencies = get_dependencies(module, name)
for dependency in dependencies:
if state == 'latest' and not query_latest(module, dependency):
to_upgrade.append(dependency)
else:
if not query_toplevel(module, name, world):
to_install.append(name)
elif state == 'latest' and not query_latest(module, name):
to_upgrade.append(name)
if to_upgrade:
upgrade = True
if not to_install and not upgrade:
module.exit_json(changed=False, msg="package(s) already installed")
packages = " ".join(to_install + to_upgrade)
if upgrade:
if module.check_mode:
cmd = "%s add --upgrade --simulate %s" % (APK_PATH, packages)
else:
cmd = "%s add --upgrade %s" % (APK_PATH, packages)
else:
if module.check_mode:
cmd = "%s add --simulate %s" % (APK_PATH, packages)
else:
cmd = "%s add %s" % (APK_PATH, packages)
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
packagelist = parse_for_packages(stdout)
if rc != 0:
module.fail_json(msg="failed to install %s" % (packages), stdout=stdout, stderr=stderr, packages=packagelist)
module.exit_json(changed=True, msg="installed %s package(s)" % (packages), stdout=stdout, stderr=stderr, packages=packagelist)
def remove_packages(module, names):
installed = []
for name in names:
if query_package(module, name):
installed.append(name)
if not installed:
module.exit_json(changed=False, msg="package(s) already removed")
names = " ".join(installed)
if module.check_mode:
cmd = "%s del --purge --simulate %s" % (APK_PATH, names)
else:
cmd = "%s del --purge %s" % (APK_PATH, names)
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
packagelist = parse_for_packages(stdout)
# Check to see if packages are still present because of dependencies
for name in installed:
if query_package(module, name):
rc = 1
break
if rc != 0:
module.fail_json(msg="failed to remove %s package(s)" % (names), stdout=stdout, stderr=stderr, packages=packagelist)
module.exit_json(changed=True, msg="removed %s package(s)" % (names), stdout=stdout, stderr=stderr, packages=packagelist)
# ==========================================
# Main control flow.
def main():
module = AnsibleModule(
argument_spec=dict(
state=dict(default='present', choices=['present', 'installed', 'absent', 'removed', 'latest']),
name=dict(type='list', elements='str'),
no_cache=dict(default=False, type='bool'),
repository=dict(type='list', elements='str'),
update_cache=dict(default=False, type='bool'),
upgrade=dict(default=False, type='bool'),
available=dict(default=False, type='bool'),
world=dict(default='/etc/apk/world', type='str'),
),
required_one_of=[['name', 'update_cache', 'upgrade']],
mutually_exclusive=[['name', 'upgrade']],
supports_check_mode=True
)
# Set LANG env since we parse stdout
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C')
global APK_PATH
APK_PATH = module.get_bin_path('apk', required=True)
p = module.params
if p['no_cache']:
APK_PATH = "%s --no-cache" % (APK_PATH, )
# add repositories to the APK_PATH
if p['repository']:
for r in p['repository']:
APK_PATH = "%s --repository %s --repositories-file /dev/null" % (APK_PATH, r)
# normalize the state parameter
if p['state'] in ['present', 'installed']:
p['state'] = 'present'
if p['state'] in ['absent', 'removed']:
p['state'] = 'absent'
if p['update_cache']:
update_package_db(module, not p['name'] and not p['upgrade'])
if p['upgrade']:
upgrade_packages(module, p['available'])
if p['state'] in ['present', 'latest']:
install_packages(module, p['name'], p['state'], p['world'])
elif p['state'] == 'absent':
remove_packages(module, p['name'])
if __name__ == '__main__':
main()

410
library/aur.py Normal file
View File

@ -0,0 +1,410 @@
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url
import json
import shlex
import tarfile
import os
import os.path
import shutil
import tempfile
import urllib.parse
DOCUMENTATION = '''
---
module: aur
short_description: Manage packages from the AUR
description:
- Manage packages from the Arch User Repository (AUR)
author:
- Kewl <xrjy@nygb.rh.bet(rot13)>
options:
name:
description:
- Name or list of names of the package(s) to install or upgrade.
state:
description:
- Desired state of the package.
default: present
choices: [ present, latest ]
upgrade:
description:
- Whether or not to upgrade whole system.
default: no
type: bool
update_cache:
description:
- Whether or not to update_cache the package cache.
default: no
type: bool
use:
description:
- The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.
default: auto
choices: [ auto, yay, paru, pacaur, trizen, pikaur, aurman, makepkg ]
extra_args:
description:
- Arguments to pass to the tool.
Requires that the 'use' option be set to something other than 'auto'.
type: str
skip_pgp_check:
description:
- Only valid with makepkg.
Skip PGP signatures verification of source file.
This is useful when installing packages without GnuPG (properly) configured.
Cannot be used unless use is set to 'makepkg'.
type: bool
default: no
ignore_arch:
description:
- Only valid with makepkg.
Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.
Cannot be used unless use is set to 'makepkg'.
type: bool
default: no
aur_only:
description:
- Limit helper operation to the AUR.
type: bool
default: no
local_pkgbuild:
description:
- Only valid with makepkg or pikaur.
Directory with PKGBUILD and build files.
Cannot be used unless use is set to 'makepkg' or 'pikaur'.
type: path
default: no
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
'''
RETURN = '''
msg:
description: action that has been taken
helper:
description: the helper that was actually used
'''
EXAMPLES = '''
- name: Install trizen using makepkg, skip if trizen is already installed
aur: name=trizen use=makepkg state=present
become: yes
become_user: aur_builder
'''
def_lang = ['env', 'LC_ALL=C', 'LANGUAGE=C']
use_cmd = {
'yay': ['yay', '-S', '--noconfirm', '--needed', '--cleanafter'],
'paru': ['paru', '-S', '--noconfirm', '--needed', '--cleanafter'],
'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'],
'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'],
'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'],
'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--skip_news', '--pgp_fetch', '--skip_new_locations'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
use_cmd_local_pkgbuild = {
'pikaur': ['pikaur', '-P', '--noconfirm', '--noedit', '--needed', '--install'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
has_aur_option = ['yay', 'paru', 'pacaur', 'trizen', 'pikaur', 'aurman']
def package_installed(module, package):
"""
Determine if the package is already installed
"""
rc, _, _ = module.run_command(['pacman', '-Q', package], check_rc=False)
return rc == 0
def check_packages(module, packages):
"""
Inform the user what would change if the module were run
"""
would_be_changed = []
diff = {
'before': '',
'after': '',
}
for package in packages:
installed = package_installed(module, package)
if not installed:
would_be_changed.append(package)
if module._diff:
diff['after'] += package + "\n"
if would_be_changed:
status = True
if len(packages) > 1:
message = '{} package(s) would be installed'.format(len(would_be_changed))
else:
message = 'package would be installed'
else:
status = False
if len(packages) > 1:
message = 'all packages are already installed'
else:
message = 'package is already installed'
module.exit_json(changed=status, msg=message, diff=diff)
def build_command_prefix(use, extra_args, skip_pgp_check=False, ignore_arch=False, aur_only=False, local_pkgbuild=None, update_cache=False):
"""
Create the prefix of a command that can be used by the install and upgrade functions.
"""
if local_pkgbuild:
command = def_lang + use_cmd_local_pkgbuild[use]
else:
command = def_lang + use_cmd[use]
if skip_pgp_check:
command.append('--skippgpcheck')
if ignore_arch:
command.append('--ignorearch')
if aur_only and use in has_aur_option:
command.append('--aur')
if local_pkgbuild and use != 'makepkg':
command.append(local_pkgbuild)
if update_cache:
command.append('-y')
if extra_args:
command += shlex.split(extra_args)
return command
def install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild=None):
"""
Install the specified package or a local PKGBUILD with makepkg
"""
if not local_pkgbuild:
module.get_bin_path('fakeroot', required=True)
f = open_url('https://aur.archlinux.org/rpc/?v=5&type=info&arg={}'.format(urllib.parse.quote(package)))
result = json.loads(f.read().decode('utf8'))
if result['resultcount'] != 1:
return (1, '', 'package {} not found'.format(package))
result = result['results'][0]
f = open_url('https://aur.archlinux.org/{}'.format(result['URLPath']))
with tempfile.TemporaryDirectory() as tmpdir:
if local_pkgbuild:
shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True)
command = build_command_prefix('makepkg', extra_args)
rc, out, err = module.run_command(command, cwd=tmpdir, check_rc=True)
else:
tar = tarfile.open(mode='r|*', fileobj=f)
tar.extractall(tmpdir)
tar.close()
command = build_command_prefix('makepkg', extra_args, skip_pgp_check=skip_pgp_check, ignore_arch=ignore_arch)
rc, out, err = module.run_command(command, cwd=os.path.join(tmpdir, result['Name']), check_rc=True)
return (rc, out, err)
def install_local_package(module, package, use, extra_args, local_pkgbuild):
"""
Install the specified package with a local PKGBUILD
"""
with tempfile.TemporaryDirectory() as tmpdir:
shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True)
command = build_command_prefix(use, extra_args, local_pkgbuild=tmpdir + '/PKGBUILD')
rc, out, err = module.run_command(command, check_rc=True)
return (rc, out, err)
def check_upgrade(module, use):
"""
Inform user how many packages would be upgraded
"""
rc, stdout, stderr = module.run_command([use, '-Qu'], check_rc=True)
data = stdout.split('\n')
data.remove('')
module.exit_json(
changed=len(data) > 0,
msg="{} package(s) would be upgraded".format(len(data)),
helper=use,
)
def upgrade(module, use, extra_args, aur_only, update_cache):
"""
Upgrade the whole system
"""
assert use in use_cmd
command = build_command_prefix(use, extra_args, aur_only=aur_only, update_cache=update_cache)
command.append('-u')
rc, out, err = module.run_command(command, check_rc=True)
module.exit_json(
changed=not (out == '' or 'nothing to do' in out.lower() or 'No AUR updates found' in out),
msg='upgraded system',
helper=use,
)
def install_packages(module, packages, use, extra_args, state, skip_pgp_check, ignore_arch, aur_only, local_pkgbuild, update_cache):
"""
Install the specified packages
"""
if local_pkgbuild:
assert use in use_cmd_local_pkgbuild
else:
assert use in use_cmd
changed_iter = False
for package in packages:
if state == 'present':
if package_installed(module, package):
rc = 0
continue
if use == 'makepkg':
rc, out, err = install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild)
elif local_pkgbuild:
rc, out, err = install_local_package(module, package, use, extra_args, local_pkgbuild)
else:
command = build_command_prefix(use, extra_args, aur_only=aur_only, update_cache=update_cache)
command.append(package)
rc, out, err = module.run_command(command, check_rc=True)
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out.lower())
message = 'installed package(s)' if changed_iter else 'package(s) already installed'
module.exit_json(
changed=changed_iter,
msg=message if not rc else err,
helper=use,
rc=rc,
)
def make_module():
module = AnsibleModule(
argument_spec={
'name': {
'type': 'list',
},
'state': {
'default': 'present',
'choices': ['present', 'latest'],
},
'upgrade': {
'type': 'bool',
},
'update_cache': {
'default': False,
'type': 'bool',
},
'use': {
'default': 'auto',
'choices': ['auto'] + list(use_cmd.keys()),
},
'extra_args': {
'default': None,
'type': 'str',
},
'skip_pgp_check': {
'default': False,
'type': 'bool',
},
'ignore_arch': {
'default': False,
'type': 'bool',
},
'aur_only': {
'default': False,
'type': 'bool',
},
'local_pkgbuild': {
'default': None,
'type': 'path',
},
},
mutually_exclusive=[['name', 'upgrade']],
required_one_of=[['name', 'upgrade']],
supports_check_mode=True
)
params = module.params
use = params['use']
if params['name'] == []:
module.fail_json(msg="'name' cannot be empty.")
if use == 'auto':
if params['extra_args'] is not None:
module.fail_json(msg="'extra_args' cannot be used with 'auto', a tool must be specified.")
use = 'makepkg'
# auto: select the first helper for which the bin is found
for k in use_cmd:
if module.get_bin_path(k):
use = k
break
if use != 'makepkg' and (params['skip_pgp_check'] or params['ignore_arch']):
module.fail_json(msg="This option is only available with 'makepkg'.")
if not (use in use_cmd_local_pkgbuild) and params['local_pkgbuild']:
module.fail_json(msg="This option is not available with '%s'" % use)
if params['local_pkgbuild'] and not os.path.isdir(params['local_pkgbuild']):
module.fail_json(msg="Directory %s not found" % (params['local_pkgbuild']))
if params['local_pkgbuild'] and not os.access(params['local_pkgbuild'] + '/PKGBUILD', os.R_OK):
module.fail_json(msg="PKGBUILD inside %s not readable" % (params['local_pkgbuild']))
if params.get('upgrade', False) and use == 'makepkg':
module.fail_json(msg="The 'upgrade' action cannot be used with 'makepkg'.")
return module, use
def apply_module(module, use):
params = module.params
if params.get('upgrade', False):
if module.check_mode:
check_upgrade(module, use)
else:
upgrade(module, use, params['extra_args'], params['aur_only'], params['update_cache'])
else:
if module.check_mode:
check_packages(module, params['name'])
else:
install_packages(module,
params['name'],
use,
params['extra_args'],
params['state'],
params['skip_pgp_check'],
params['ignore_arch'],
params['aur_only'],
params['local_pkgbuild'],
params['update_cache'])
def main():
module, use = make_module()
apply_module(module, use)
if __name__ == '__main__':
main()

View File

@ -1,12 +1,17 @@
---
- name: Bedrock Linux Desktop Setup
description: Installs my bedrock linux desktop setup (designed to setup EVERYTHING other than the minimal desktop base)
- name: Bedrock Linux Desktop Setup - designed to setup EVERYTHING other than the minimal desktop base
hosts: localhost
connection: local
become: True
roles:
- { role: bedrock-config}
- { role: alpine}
- { role: arch}
- { role: packages-development}
- { role: packages-graphics}
- { role: packages-terminal}
# - { role: network, tags: ['network'] }
# - { role: kernel, tags: ['kernel'] }
# - { role: base, tags: ['base'] }

View File

@ -0,0 +1,20 @@
---
- name: Fetch new alpine strata
include_role:
name: fetch-strata
vars:
strata: alpine
tags: clean
- name: Enable community repo
ansible.builtin.shell:
cmd: cat /bedrock/strata/alpine/etc/apk/repositories | head -n1 | sed 's/main/community/g' >> /bedrock/strata/alpine/etc/apk/repositories
- name: Enable https on the repositories
ansible.builtin.replace:
path: /bedrock/strata/alpine/etc/apk/repositories
regexp: '^https?://'
replace: 'https://'

View File

@ -0,0 +1,42 @@
---
- name: Fetch new arch strata
include_role:
name: fetch-strata
vars:
strata: arch
tags: clean
- name: Enable AUR support (install base devel)
pacman: name=base-devel
- name: Install yay
aur: name=yay
become_user: daniel
- name: Enable pacman color
ansible.builtin.lineinfile:
path: /bedrock/strata/arch/etc/pacman.conf
regexp: '^#? ?Color'
line: Color
- name: Enable pacman parallel downloads
ansible.builtin.lineinfile:
path: /bedrock/strata/arch/etc/pacman.conf
regexp: '^#? ?ParallelDownloads ?= ?'
line: ParallelDownloads = 5
- name: Enable multilib in pacman
lineinfile:
dest: /bedrock/strata/arch/etc/pacman.conf
state: present
line: "[multilib]"
regexp: "^\\[multilib\\]"
insertafter: "^#\\[multilib\\]"
- name: Enable multilib in pacman (cont)
lineinfile:
dest: /bedrock/strata/arch/etc/pacman.conf
state: present
line: "Include = /etc/pacman.d/mirrorlist"
insertafter: "^\\[multilib\\]"
regexp: "Include = /etc/pacman.d/mirrorlist"

View File

@ -0,0 +1,26 @@
---
- name: Find if {{strata}} strata exists
stat:
path: /bedrock/strata/{{ strata }}
register: strata_folder
- name: Find if backup {{strata}} strata exists
stat:
path: /bedrock/strata/{{ strata }}.backup
register: strata_backup
- name: Delete previous backup {{ strata }} strata
ansible.builtin.shell:
cmd: brl remove {{ strata }}.backup
when: strata_backup.stat.exists and strata_folder.stat.exists
- name: Backup old {{ strata }} strata
ansible.builtin.shell: |
brl disable {{ strata }}
brl rename {{ strata }} {{ strata }}.backup
brl hide {{ strata }}.backup
when: strata_folder.stat.exists

View File

@ -0,0 +1,14 @@
---
- name: Change pmm's user interface to pacman
ansible.builtin.lineinfile:
path: /bedrock/etc/bedrock.conf
regexp: '^user-interface ='
line: user-interface = pacman
- name: Change pmm's to allow non-system package managers
ansible.builtin.lineinfile:
path: /bedrock/etc/bedrock.conf
regexp: '^ignore-non-system-package-managers ='
line: ignore-non-system-package-managers = false

View File

@ -0,0 +1,10 @@
---
- name: Backup and remove old {{ strata }} strata
include_role:
name: backup-remove-strata
- name: Fetch {{ strata }} strata
ansible.builtin.shell:
cmd: brl fetch {{ strata }}

View File

@ -0,0 +1,6 @@
---
- name: Install brave
aur:
name: brave-bin
become_user: daniel

View File

@ -0,0 +1,16 @@
---
- name: Install Godot
pacman: name=godot
- name: Install VSCodium
aur:
name: vscodium-bin
become_user: daniel
- name: Fix VSCodium Sandbox
ansible.builtin.shell:
cmd: chmod u+s /bedrock/strata/arch/opt/vscodium-bin/chrome-sandbox
- name: Install terminator
pacman: name=terminator

View File

@ -0,0 +1,21 @@
---
- name: Install legendary
aur:
name: legendary
become_user: daniel
- name: Install lutris
pacman: name=lutris
- name: Install lutris depends
pacman: name=lib32-mesa vulkan-radeon lib32-vulkan-radeon vulkan-icd-loader lib32-vulkan-icd-loader wine lib32-gnutls
- name: Install Heroic Launcher
aur:
name: heroic-games-launcher-bin
become_user: daniel
- name: Fix Heroic Sandbox
ansible.builtin.shell:
cmd: chmod u+s /bedrock/strata/arch/opt/Heroic/chrome-sandbox

View File

@ -0,0 +1,16 @@
---
- name: Install Krita
pacman: name=krita
- name: Install Gimp
pacman: name=gimp
- name: Install Blender
pacman: name=blender
- name: Install Pixelorama
aur: name=pixelorama-bin
become_user: daniel

View File

@ -0,0 +1,11 @@
---
- name: Install onlyoffice
aur:
name: onlyoffice-bin
become_user: daniel
- name: Install logseq
aur:
name: logseq-desktop-bin
become_user: daniel

View File

@ -0,0 +1,4 @@
---
- name: Install Signal Desktop
pacman: name=signal-desktop

View File

@ -0,0 +1,59 @@
---
- name: Update repositories
apk:
update_cache: yes
- name: Install fish shell
apk:
name: fish
world: /bedrock/strata/alpine/etc/apk/world
- name: Install micro
apk:
name: micro
world: /bedrock/strata/alpine/etc/apk/world
- name: Install git
apk:
name: git
world: /bedrock/strata/alpine/etc/apk/world
- name: Install bat
apk:
name: bat
world: /bedrock/strata/alpine/etc/apk/world
- name: Install btop
apk:
name: btop
world: /bedrock/strata/alpine/etc/apk/world
- name: Install ncdu
apk:
name: ncdu
world: /bedrock/strata/alpine/etc/apk/world
- name: Install cowsay
aur:
name: cowsay
- name: Install thefuck
aur:
name: thefuck
- name: Install gum
aur:
name: gum
become_user: daniel
- name: Install pingu
aur:
name: pingu
become_user: daniel
- name: Install rbw
aur:
name: rbw
become_user: daniel