Meta tags:
description= Posts about python written by liquidat;
Headings (most frequently used words):
python, using, in, short, tip, virtual, environment, howto, toolbox, rhel, for, of, getting, my, tool, ansible, isolated, posts, tag, nushell, fedora, easy, management, cli, tools, the, rational, started, first, ready, our, summary, get, running, on, handling, can, concat, str, to, bytes, error, uri, module, debugging, tower, and, underlying, cloud, images, background, nodes, problem, node, unavailable, analysis, searching, package, origin, conclusion, pagination, search, recent, contact, pages, blogroll, license, cc, by, sa, blog, stats,
Text of the page (most frequently used words):
the (116), #ansible (84), and (65), toolbox (45), #python (40), with (39), function (36), for (35), liquidat (34), was (34), environment (31), this (29), you (29), that (27), rhel (25), container (23), fedora (21), can (20), home (19), are (19), not (19), tower (19), linux (18), virtual (17), have (15), cloud (15), module (15), when (15), tools (15), com (14), march (14), version (14), install (14), how (14), run (14), use (14), create (13), your (13), short (13), using (13), all (13), packages (13), installed (13), system (13), may (12), 2006 (12), 2007 (12), 2008 (12), red (12), hat (12), package (12), versions (12), psutil (12), isolated (12), june (11), september (11), december (11), tip (11), images (11), management (11), image (11), example (11), error (11), development (11), name (10), april (10), august (10), 2013 (10), 2014 (10), about (10), line (10), shell (10), but (10), pip (10), file (10), tmp (10), even (10), 2005 (9), july (9), 2016 (9), 2019 (9), more (9), just (9), see (9), python3 (9), 2020 (8), which (8), created (8), via (8), nushell (8), search (8), enterprise (8), one (8), way (8), lib (8), nodes (8), like (8), running (8), bin (8), site (7), other (7), blog (7), october (7), november (7), january (7), february (7), 2018 (7), 2021 (7), them (7), new (7), false (7), has (7), node (7), want (7), distributions (7), tool (7), work (6), get (6), debugging (6), library (6), there (6), changed (6), since (6), access (6), available (6), some (6), cpu_count (6), first (6), into (6), environments (6), uri (6), local (6), howto (6), different (6), usr (6), might (6), activate (6), makes (6), cli (6), silverblue (6), libraries (6), overlay (6), website (5), comment (5), content (5), 2015 (5), 2017 (5), any (5), org (5), multiple (5), page (5), tags (5), technology (5), security (5), rpm (5), categories (5), posted (5), author (5), called (5), issue (5), did (5), think (5), from (5), never (5), default (5), why (5), test (5), also (5), here (5), var (5), remote (5), problem (5), especially (5), set (5), those (5), concat (5), str (5), simple (5), our (5), properly (5), easy (5), let (5), command (5), containers (5), free (4), wordpress (4), log (4), manage (4), however (4), only (4), information (4), license (4), recent (4), base (4), after (4), part (4), openstack (4), then (4), used (4), while (4), bug (4), indeed (4), weird (4), very (4), gcc (4), help (4), sure (4), call (4), isonode (4), __main__ (4), happened (4), unavailable (4), instance (4), status (4), things (4), feature (4), lot (4), bytes (4), url (4), https (4), venv (4), myvirtual_venv (4), selinux (4), source (4), done (4), same (4), immutable (4), plugins (4), modules (4), share (4), location (4), newest (4), root (4), offers (4), operating (4), dependencies (4), pipeline (4), start (3), own (3), report (3), now (3), next (3), leave (3), suse (3), debian (3), ubuntu (3), avoid (3), during (3), well (3), update (3), updated (3), channels (3), something (3), showed (3), really (3), distribution (3), setup (3), were (3), newer (3), most (3), these (3), where (3), import (3), cpu (3), idea (3), code (3), inspect (3), added (3), missing (3), failed (3), awx (3), 1552400585 (3), 60203645751230 (3), ansiballz_awx_capacity (3), ansible_awx_capacity_payload_6p5khp (3), what (3), inside (3), around (3), automation (3), piece (3), normal (3), trust (3), body (3), github (3), another (3), lib64 (3), sense (3), comes (3), changes (3), time (3), read (3), ready (3), registry (3), fedoraproject (3), f31 (3), ago (3), collecting (3), readme (3), usual (3), started (3), fully (3), podman (3), certain (3), applications (3), packaging (3), hard (3), often (3), clutter (3), core (3), virtualenv (3), bundle (3), write (2), comments (2), sign (2), 2023 (2), 2024 (2), ask (2), social (2), mastodon (2), data (2), services (2), posts (2), underlying (2), business (2), future (2), having (2), case (2), outdated (2), instead (2), much (2), would (2), been (2), serious (2), meantime (2), still (2), checked (2), creation (2), heat (2), main (2), apparently (2), assume (2), along (2), wondered (2), shipped (2), released (2), had (2), old (2), sep (2), 20150623 (2), linux2 (2), type (2), copyright (2), credits (2), multiprocessing (2), working (2), entire (2), functions (2), _assert_pid_not_reused (2), avail_phymem (2), avail_virtmem (2), cached_phymem (2), cpu_percent (2), cpu_times (2), cpu_times_percent (2), disk_io_counters (2), disk_partitions (2), disk_usage (2), get_boot_time (2), get_pid_list (2), get_process_list (2), get_users (2), namedtuple (2), net_io_counters (2), network_io_counters (2), phymem_buffers (2), phymem_usage (2), pid_exists (2), process_iter (2), swap_memory (2), total_virtmem (2), used_phymem (2), used_virtmem (2), virtmem_usage (2), virtual_memory (2), wait_procs (2), machine (2), note (2), check (2), support (2), get_cpu_capacity (2), none (2), fatal (2), connection (2), traceback (2), last (2), _ansiballz_main (2), invoke_module (2), msg (2), tried (2), again (2), able (2), groups (2), problematic (2), installation (2), software (2), infrastructure (2), ssh (2), job (2), managed (2), will (2), nice (2), recently (2), experimenting (2), somehow (2), told (2), should (2), arbitrary (2), handling (2), payload (2), took (2), problems (2), body_format (2), json (2), option (2), provided (2), thus (2), localhost (2), www (2), post (2), because (2), kinds (2), machines (2), independent (2), occurred (2), need (2), rhel8 (2), appstreams (2), appstream (2), make (2), right (2), bindings (2), link (2), dealing (2), already (2), afterwards (2), sudo (2), yum (2), handled (2), learn (2), nevertheless (2), interesting (2), based (2), additional (2), top (2), ostree (2), try (2), easily (2), without (2), list (2), minutes (2), enter (2), config (2), cfg (2), configured (2), path (2), executable (2), jan (2), 20190827 (2), reuse (2), remember (2), jinja2 (2), getting (2), limited (2), unprivileged (2), look (2), dnf (2), download (2), docs (2), basic (2), commands (2), easier (2), always (2), sand (2), flatpak (2), tooling (2), requires (2), specific (2), parallel (2), updates (2), shortcomings (2), notice (2), 116 (2), export (2), alias (2), pydoc (2), allowed (2), setuptools (2), wheel (2), email, loading, collapse, bar, subscriptions, view, reader, privacy, account, join, 344, subscribers, subscribed, subscribe, 2009, 2010, 2022, 152, 473, hits, stats, beware, refers, parts, obviously, written, licensing, quoted, text, pictures, others, copyrighted, corresponding, authors, doubt, before, republishing, licensed, under, creative, commons, attribution, sharealike, wall, skills, spread, knowledge, netzpolitik, kool, solutions, isovalent, finding, marbles, eva, wolters, heilpraktikerin, für, psychotherapie, dresden, und, meißen, cilium, blogroll, pages, project, bluesky, bsky, mail, bayz, contact, plot, live, terminal, processing, loop, columns, table, combined, journal, entries, systemd, kernel, messages, pagination, learned, lesson, critical, checking, detail, nasty, surprises, production, recommend, take, exposed, although, rpms, manageable, track, present, existing, someone, tricky, verified, script, configuration, vendor, conclusion, initial, forgotten, snapshots, defaults, question, repos, removed, stayed, waiting, blame, likely, needed, once, demo, end, fact, come, redhat, results, filling, such, ancient, early, quick, result, solve, updating, multiprocessor, searching, origin, getmembers, isfunction, 0x7f9eb10a8d70, _deprecated, deprecated, 0x7f9eb38ec320, _wraps, wraps, 0x7f9eb414f848, 0x7f9eb0c32ed8, 0x7f9eb0c36398, 0x7f9eb10a86e0, 0x7f9eb0c32320, 0x7f9eb0c322a8, 0x7f9eb0c326e0, 0x7f9eb0c32938, 0x7f9eb0c328c0, 0x7f9eb0c32848, 0x7f9eb0c32a28, 0x7f9eb0c4b410, 0x7f9eb0c32c08, 0x7f9eb0c32aa0, 0x7f9ebc84df50, 0x7f9eb0c329b0, 0x7f9eb0c36500, 0x7f9eb10a8848, 0x7f9eb0c32cf8, 0x7f9eb0c32140, 0x7f9eb0c321b8, 0x7f9eb0c327d0, 0x7f9eb0c32b18, 0x7f9eb0c361b8, 0x7f9eb0c36050, 0x7f9eb0c362a8, 0x7f9eb0c32de8, 0x7f9eb0c32758, 0x7f9eb0c32230, ensure, backporting, directly, queryformat, date, pretty, pre, history, enhancements, 424, windows, installer, bit, 427, number, logical, physical, cpus, def, env_forkcpu, getenv, system_task_forks_cpu, awx_capacity, tail, module_stderr, shared, closed, module_stdout, 113, 105, zipped_mod, temp_path, ansiballz_params, imp, load_module, mod, mod_desc, nattributeerror, object, attribute, failure, nsee, stdout, stderr, exact, play, recap, unreachable, logs, analysis, turn, off, button, control, interface, made, executed, jobs, became, quickly, soon, showing, they, marked, lab, fooling, clustered, vms, trouble, though, handy, sensitive, dmzs, network, separation, spotlight, contains, small, playbooks, locally, deployed, behind, firewall, vpc, datacenter, targets, its, pushed, over, dedicated, instances, separated, basically, proxy, background, stupidity, programming, http, curl, hunting, dare, long, figure, out, person, who, provide, solved, explicitly, stated, assumed, raw, format, fill, thought, too, couldn, imagine, hitting, realized, side, meant, show, byte, hosts, gather_facts, tasks, method, myngfw, drove, almost, nuts, tested, devel, upstream, service, targeted, earlier, playbook, showcase, suspiciously, exception, task, execution, full, vvv, typeerror, elapsed, 200, unknown, redirected, today, strange, web, rest, apis, surprising, automate, integrate, libs, offered, pick, _selinux, cpython, 36m, x86_64, gnu, python36, best, important, anyway, everything, year, modern, among, included, isn, gnome, approach, simplify, fool, become, crucial, daily, operations, pain, worth, summary, state, left, proper, daemon, experiment, worrying, cluttering, wrong, being, dependency, 64e68e194389, weeks, 8ec117845e06, exit, later, exactly, built, fairly, user, cached, files, pythonhosted, c717363f767f7af33d90af9458d5f1e0960db9c2393a6c221c2ce97ad1aa, tar, successfully, markupsafe, pyyaml, cffi, cryptography, pycparser, mentioned, actual, interact, identified, host, pwd, documents, downloads, boot, dev, etc, lost, found, media, mnt, opt, proc, sbin, srv, sys, cat, debarshiray, greeted, message, dropped, bubble, prompt, touch, differentiate, welcome, manner, documentation, downloaded, required, 500mb, good, usable, needs, takes, care, volume, mounting, necessary, bits, enables, simpler, than, typing, fledged, docker, particularly, systems, regular, tests, mutable, affecting, familiar, developing, runs, complex, behavior, sometimes, depends, keep, up2date, across, speak, don, cluttered, justify, application, requirements, impossible, possible, recreate, works, less, through, multi, boxing, meaning, better, protection, independence, their, similar, means, essentially, solves, many, rational, focus, keeping, seen, shift, away, purpose, towards, stable, boxed, enable, advanced, brings, aim, direction, technologies, context, gui, additionally, course, app, streams, bash, virtualization, downloading, py3, whl, eta, release, upgrade, 20s, continue, operate, parser, unexpected_keyword, statement, 117, deactivate, hide, keyword, itself, outside, catch, does, switch, cpython3, final, 190ms, creator, cpython3posix, dest, clear, no_vcs_ignore, global, seeder, fromappdata, extra_search_dir, wheels, copy, app_data_dir, seed, activators, bashactivator, cshellactivator, fishactivator, nushellactivator, powershellactivator, pythonactivator, supported, becoming, every, day, thing, past, capability, tag, open, skip,
Text of the page (random words):
basic idea for using containers and especially toolbox is similar to the one about flatpak it solves many problems of the linux packaging problem this means essentially independence from os libraries and their versions sand boxing meaning better protection of the os multi version support less os clutter through isolated installation of dependencies easy to recreate environments think of works on my machine immutable environments possible think of it that way with complex applications behavior sometimes depends on certain versions of some libraries when those are managed by the os packaging system it is hard to keep them up2date or just in the same version across multiple machines not to speak about multiple distributions also i don t want my os to be cluttered with weird dependencies which i might not even trust just to justify a weird application s requirements and i might want to install different versions of a tool to test them with different libraries as well which is often impossible with os package management toolbox in comes toolbox toolbox is a tool that offers a familiar package based environment for developing and debugging software that runs fully unprivileged using podman the toolbox container is a fully mutable container when you see yum install ansible for example that s something you can do inside your toolbox container without affecting the base operating system toolbox on github while toolbox is particularly interesting for immutable systems like fedora silverblue it even makes sense to run it on other distributions i started using it on my regular fedora for example just to have certain tools available in certain versions for tests and why use toolbox and not just the usual container tools toolbox takes care of volume mounting and all the other necessary bits of container management and enables you to just use a very basic set of commands to create and reuse your tool containers it is simpler and easier than always typing in fully fledged podman or docker commands all the time you can read more about toolbox in the fedora silverblue toolbox docs or the red hat enterprise linux 8 toolbox docs getting started it is very easy to get started with toolbox first it needs to be installed on the system for example on fedora 31 this can be done via sudo dnf install toolbox after that you are good to go since the idea is to have re usable containers let s create the first in my example i want to have a container with the newest ansible version to run some automation so we just create a new container called ansible toolbox create container ansible image required to create toolbox container download registry fedoraproject org f31 fedora toolbox 31 500mb y n y created container ansible as you see a base image for my distribution was downloaded and the container created next let s access it and look around toolbox enter container ansible welcome to the toolbox a container where you can install and run all your tools use dnf in the usual manner to install command line tools to create a new tools container run toolbox create for more information see the documentation liquidat toolbox we are greeted with a short message and then dropped to a shell note the bubble at the start of the command prompt a nice touch to differentiate if you are inside a toolbox or not next let s look at our environment liquidat toolbox pwd home liquidat liquidat toolbox ls bin development documents downloads liquidat toolbox ls readme md bin boot dev etc home lib lib64 lost found media mnt opt proc root run sbin srv sys tmp usr var liquidat toolbox cat readme md toolbox unprivileged development environment toolbox https github com debarshiray toolbox is a tool that offers a as you see the toolbox has actual access to the file system that way we can use the tools just like normal shell tools interact with things we have in our environment however at the same time we have limited access to the root system since we see the container root system as identified by the readme not the host root system getting my first tool ready as mentioned i d like to have a container with the newest ansible let s install it liquidat toolbox pip install user ansible collecting ansible using cached https files pythonhosted org packages ae b7 c717363f767f7af33d90af9458d5f1e0960db9c2393a6c221c2ce97ad1aa ansible 2 9 6 tar gz collecting jinja2 from ansible running setup py install for ansible done successfully installed markupsafe 1 1 1 pyyaml 5 3 ansible 2 9 6 cffi 1 14 0 cryptography 2 8 jinja2 2 11 1 pycparser 2 20 liquidat toolbox ansible version ansible 2 9 6 config file home liquidat ansible cfg configured module search path home liquidat ansible plugins modules usr share ansible plugins modules ansible python module location home liquidat local lib python3 7 site packages ansible executable location home liquidat local bin ansible python version 3 7 6 default jan 30 2020 09 44 41 gcc 9 2 1 20190827 red hat 9 2 1 1 as you see ansible was properly installed and with this we are already done we have our first tool ready name ansible using our tool now let s assume i use the container for some things exit it and want to reuse it later on this is no problem at all since that is exactly what toolbox was built for and we have a name which makes it fairly easy to remember how to access it but even if we do not remember the name we can easily list all available tools toolbox list image id image name created 64e68e194389 registry fedoraproject org f31 fedora toolbox 31 2 weeks ago container id container name created status image name 8ec117845e06 ansible 47 minutes ago up 47 minutes ago registry fedoraproject org f31 fedora toolbox 31 toolbox enter c ansible liquidat toolbox ansible version ansible 2 9 6 config file home liquidat ansible cfg configured module search path home liquidat ansible plugins modules usr share ansible plugins modules ansible python module location home liquidat local lib python3 7 site packages ansible executable location home liquidat local bin ansible python version 3 7 6 default jan 30 2020 09 44 41 gcc 9 2 1 20190827 red hat 9 2 1 1 as you see the container is in the same state as we left it ansible is still installed in the proper way and ready to be used and we can do this now with all kinds of other tools be it another version of ansible or even some daemon we want to experiment with it can all be easily installed and run and re used without worrying of cluttering the os or having the wrong library versions installed or not being able to update some library because of a system dependency summary toolbox is an interesting approach to simplify container management to fool around with cli based tools if you have an immutable environment like fedora silverblue it might become a crucial piece in your daily operations since it is a pain to install additional packages on top of silverblue s ostree infrastructure but even for normal distributions it is worth a try author liquidat posted on march 16 2020 march 16 2020 categories ansible cloud fedora rhel gnome howto linux rpm security shell technology tags fedora fedora 31 fedora silverblue pip python python3 red hat enterprise linux red hat enterprise linux 8 rhel rhel8 venv virtual environment leave a comment on howto using toolbox in fedora rhel 8 for easy management of cli tools howto get a python virtual environment running on rhel 8 rhel 8 has a new way how python is installed and handled how do you use it properly then especially when multiple versions are installed read on to learn how to properly set up a virtual environment nevertheless rhel 8 has a new way how python is installed and handled how do you use it properly then especially when multiple versions are installed read on to learn how to properly set up a virtual environment nevertheless red hat enterprise linux 8 was released in may this year and comes with a lot of changes think of a really modern os here among those changes is also that python is well different it is included for sure but at the same time it isn t the important piece is anyway that when you work with python in development environments or for example when you are dealing with ansible it makes sense to run everything in a python virtual environment here is how this can be best done in rhel 8 first install the python 3 6 appstream sudo yum install y python36 afterwards set up a python virtual environment python3 6 m venv myvirtual_venv and that s it already activate it with source myvirtual_venv bin activate in case you are dealing with selinux bindings it might make sense to link those into your virtual environment cd myvirtual_venv lib python3 6 site packages ln s usr lib64 python3 6 site packages selinux ln s usr lib64 python3 6 site packages _selinux cpython 36m x86_64 linux gnu so when in the future different versions of python are offered via appstreams make sure to pick the right selinux bindings when you link them into your virtual environment another way to work with selinux libs is to create the virtual environment by using system packages python3 6 m venv system site packages myvirtual_venv author liquidat posted on august 30 2019 october 26 2019 categories ansible cloud fedora rhel howto linux rpm shell technology tags appstream appstreams pip python python3 red hat enterprise linux 8 rhel rhel8 venv virtual environment 1 comment on howto get a python virtual environment running on rhel 8 short tip handling can t concat str to bytes error in ansible s uri module when working with web services especially rest apis ansible can be of surprising help when you need to automate those our want to integrate them into your automation however today i run into a strange python bug while i tried to use the uri module an exception occurred during task execution to see the full traceback use vvv the error was typeerror can t concat str to bytes fatal localhost failed changed false content elapsed 0 msg status code was 1 and not 200 an unknown error occurred can t concat str to bytes redirected false status 1 url https www ansible com this drove me almost nuts because it happened on all kinds of machines i tested even with ansible s devel upstream version it was even independent of the service i targeted the error happened way earlier and a playbook to showcase this was suspiciously short and simple name show concat str byte error hosts localhost connection local gather_facts no tasks name call problematic url call uri url https www ansible com method post body name myngfw when i was about to fill an issue at ansible s github page i thought again and wondered that this is too simple i couldn t imagine that i was the only one hitting this problem i realized that the error had to be on my side and thus meant that something was missing and indeed the body_format option was not explicitly stated so ansible assumed raw while my body data were provided in json format a simple body_format json solved my problems never dare to ask me how long it took me to figure this one out and that from the person who write and entire how to about how to provide payload with the ansible uri module author liquidat posted on august 22 2019 december 1 2021 categories ansible cloud debian ubuntu fedora rhel linux security shell short tip suse technology tags ansible body bug bug hunting curl error http issue payload problem programming python stupidity uri url 12 comments on short tip handling can t concat str to bytes error in ansible s uri module of debugging ansible tower and underlying cloud images recently i was experimenting with tower s isolated nodes feature but somehow it did not work in my environment debugging told me a lot about ansible tower and also why you should not trust arbitrary cloud images recently i was experimenting with tower s isolated nodes feature but somehow it did not work in my environment debugging told me a lot about ansible tower and also why you should not trust arbitrary cloud images background isolated nodes ansible tower has a nice feature called isolated nodes those are dedicated tower instances which can manage nodes in separated environments basically an ansible tower proxy an isolated node is an ansible tower node that contains a small piece of software for running playbooks locally to manage a set of infrastructure it can be deployed behind a firewall vpc or in a remote datacenter with only ssh access available when a job is run that targets things managed by the isolated node the job and its environment will be pushed to the isolated node over ssh where it will run as normal ansible tower feature spotlight instance groups and isolated nodes isolated nodes are especially handy when you setup your automation in security sensitive environments think of dmzs here of network separation and so on i was fooling around with a clustered tower installation on rhel 7 vms in a cloud environment when i run into trouble though my problem isolated node unavailable isolated nodes like instance groups have a status inside tower if things are problematic they are marked as unavailable and this is what happened with my instance isonode remote example com running in my lab environment ansible tower showing an instance node as unavailable i tried to turn it off and on again with the button in the control interface it made the node available it was even able to executed jobs but it became quickly unavailable soon after analysis so what happened the tower logs showed a python error tail f var log tower tower log fatal isonode remote example com failed changed false module_stderr shared connection to isonode remote example com closed r n module_stdout traceback most recent call last r n file var lib awx ansible tmp ansible tmp 1552400585 04 60203645751230 ansiballz_awx_capacity py line 113 in module r n _ansiballz_main r n file var lib awx ansible tmp ansible tmp 1552400585 04 60203645751230 ansiballz_awx_capacity py line 105 in _ansiballz_main r n invoke_module zipped_mod temp_path ansiballz_params r n file var lib awx ansible tmp ansible tmp 1552400585 04 60203645751230 ansiballz_awx_capacity py line 48 in invoke_module r n imp load_module __main__ mod module mod_desc r n file tmp ansible_awx_capacity_payload_6p5khp __main__ py line 74 in module r n file tmp ansible_awx_capacity_payload_6p5khp __main__ py line 60 in main r n file tmp ansible_awx_capacity_payload_6p5khp __main__ py line 27 in get_cpu_capacity r nattributeerror module object has no attribute cpu_count r n msg module failure nsee stdout stderr for the exact error rc 1 play recap isonode remote example com ok 0 changed 0 unreachable 0 failed 1 apparently a python function was missing if we check the code we see that indeed in line 27 of file awx_capacity py the function psutil cpu_count is called def get_cpu_capacity env_forkcpu os getenv system_task_forks_cpu none cpu psutil cpu_count support for this function was added in version 2 0 of psutil 2014 03 10 enhancements 424 windows installer for python ...
|